Giter Club home page Giter Club logo

heroku-dyno-restarter's Introduction

Dyno Restarter

Version 0.1

A simple php script that will restart an app dynos using heroku api

To use:

Add the following to the app config variable key pairs:

SCHEDULER_LAST_DYNO_RESTART

Date of when to start the check. Suggested time is date of first execution time is 00:00:00

RESTARTER_API:{YOUR HEROKU API KEY}

RESTARTER_APP:{The app name of the where the script will run}

TARGET_APP:{The app name where dynos will be restarted}

TIME_INTERVAL:{The time in hours when dynos will be restarted}

Add a scheduler using Heroku Scheduler using php web/restartDyno.php.

Version 0.2

Added feature to restart multiple apps.

Enabled Logging.

New config vars format needed for this to work. See below:

TARGET_APP=app1,app2 - The apps that will be restarted separated by comma.

SCHEDULER_LAST_DYNO_RESTART={"app1":"{time last updated}","app2":"{time last updated }","last-restarted-app":"{name of app last restarted}"} - Must be in proper JSON format

TIME_INTERVAL={"app1":"{time interval in hours for app1}","app2":"{time interval in hours for app2}"} - Must be in proper JSON format

SHOW_DEBUG_LOGS=TRUE Set to FALSE if you don't enable execution logs.

How the execution works

On scheduler run, it will first get the last restarted app,then will select a new app to restart. If the time elapsed since last app restart is greater than or equal to the time interval set, then it will restart the target app. It will set the target app as the last restarted app so during next scheduler run it will check the next app instead.

##Contributors @ramalveyra

##Credits [@jonmountjoy(https://github.com/jonmountjoy)] - php-getting-started(https://github.com/heroku/php-getting-started)

heroku-dyno-restarter's People

Contributors

ramalveyra avatar dzuelke avatar

Watchers

 avatar

heroku-dyno-restarter's Issues

App enhancements

Add a feature to restart multiple apps:

TARGET_APP = app1, app2
TIME_INTERVAL = 9, 7
SCHEDULER_LAST_DYNO_RESTART = 30-08-2014 16:13:23, 30-08-2014 16:33:20

Restart one app per script execution, the next app can then be restarted next run if needed

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.