Skip to content
😴 Keep your free Heroku dynos awake
Ruby HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/img Adds actual logo Oct 29, 2019
lib Adds super basic styling Oct 28, 2019
tasks Renames rake task Oct 28, 2019
views Tweaks view Oct 28, 2019
.gitignore Git init Oct 28, 2019
.ruby-version Upgrades to ruby 2.6.5 and uses puma in prod Oct 28, 2019
Gemfile Upgrades to ruby 2.6.5 and uses puma in prod Oct 28, 2019
Gemfile.lock Upgrades to ruby 2.6.5 and uses puma in prod Oct 28, 2019
MIT-LICENSE Adds license Oct 29, 2019
Procfile Tweaks procfile Oct 28, 2019
README.md Upgrades to ruby 2.6.5 and uses puma in prod Oct 28, 2019
Rakefile Git init Oct 28, 2019
app.json Adds actual logo Oct 29, 2019
app.rb Adds https redirect Oct 28, 2019
config.ru Git init Oct 28, 2019

README.md

About

In a nutshell: an app that pings your free Heroku app to keep it awake.

Heroku free dynos will go to sleep after an hour of inactivity. Once the dyno is asleep, loading your application can take up to 10 seconds. This app simply pings your desired Heroku applications every 30 mins.

Heroku also caps free dyno usage so that your dyno can't be awake 24/7. This app allows you to set a window where pinging your application is paused (your app probably doesn't need to stay awake while you're sleeping).

This app is inspired by Kaffeine, and was built because Kaffeine was broken at the time.

Installation

Deploy to Heroku

Deploy

This app uses Heroku scheduler. Unfortunately, the Heroku scheduler is not currently configurable via the 'Deploy to Heroku' button. So, once the app is deployed, you will need to do the following:

  1. Go to the app overview
  2. Click on 'Heroku Scheduler' and hit 'Create Job'
  3. Schedule a job every hour at :00. The job should run bundle exec rake send_pings
  4. Schedule a job every hour at :30. The job should run bundle exec rake send_pings

Manual installation

  • Install Ruby 2.6.5
  • Run bundle install to install gems
  • Set ENV vars:
    • URLS_TO_PING: A list of URLs to ping, delimited by '||'
    • PAUSE_START_UTC_HOUR: The hour of day when pinging stops (in UTC)
    • PAUSE_END_UTC_HOUR: The hour of day when pinging starts (in UTC)
  • Run bundle exec rackup to start the server at http://localhost:9292
  • Set a cron to run bundle exec rake send_pings every 30 minutes
You can’t perform that action at this time.