Skip to content

Instantly share code, notes, and snippets.

@feifangit
Last active December 31, 2015 16:39
Show Gist options
  • Save feifangit/8014599 to your computer and use it in GitHub Desktop.
Save feifangit/8014599 to your computer and use it in GitHub Desktop.
restart heroku apps
import heroku
HEROKU_TOKEN = "xx-xx-xx" #used for instance restart
APP_NAME = "xxx"
def restart_heroku(auto=False):
'''restart heroku instance to re-allocate IP'''
cloud = heroku.from_key(HEROKU_TOKEN)
app = cloud.apps[APP_NAME]
for p in app.processes:
p.restart()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment