Skip to content

Instantly share code, notes, and snippets.

@lukaszx0
Created April 20, 2012 12:45
Show Gist options
  • Save lukaszx0/2428255 to your computer and use it in GitHub Desktop.
Save lukaszx0/2428255 to your computer and use it in GitHub Desktop.
Keeping heroku dyno alive
# $ heroku addons:add scheduler:standard
# $ heroku addons:open scheduler
require "net/http"
desc "Ping app"
task :ping do
url = 'my-app.herokuapp.com'
puts "ping? (#{url})"
r = Net::HTTP.new(url, 80).request_head('/')
puts "pong! (#{r.code} #{r.message})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment