Skip to content

Instantly share code, notes, and snippets.

@arches
Created May 12, 2013 22:11
Show Gist options
  • Select an option

  • Save arches/5565104 to your computer and use it in GitHub Desktop.

Select an option

Save arches/5565104 to your computer and use it in GitHub Desktop.
rake task to ping a url
desc "Pings PING_URL to keep a dyno alive"
task :dyno_ping do
require "net/http"
if ENV['PING_URL']
puts "Pinging #{ENV['PING_URL']}"
uri = URI(ENV['PING_URL'])
Net::HTTP.get_response(uri)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment