Created
May 12, 2013 22:11
-
-
Save arches/5565104 to your computer and use it in GitHub Desktop.
rake task to ping a url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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