Giter VIP home page Giter VIP logo

heroku-pinger's Introduction

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

heroku-pinger's People

Contributors

inoda avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.