Last active
December 31, 2015 16:39
-
-
Save feifangit/8014599 to your computer and use it in GitHub Desktop.
restart heroku apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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