Skip to content

Commit

Permalink
add heroku restart method if hard restart + update loader version (Us…
Browse files Browse the repository at this point in the history
…ergeTeam#485)

* add heroku restart if hard

* update loader to stable version
  • Loading branch information
Krishna-Singhal authored Feb 28, 2022
1 parent 4ca309d commit a114018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion min_loader.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5
2.1
5 changes: 4 additions & 1 deletion userge/core/methods/utils/restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__all__ = ['Restart']

from loader.userge.api import restart
from userge import logging
from userge import logging, config
from ...ext import RawClient

_LOG = logging.getLogger(__name__)
Expand All @@ -22,4 +22,7 @@ class Restart(RawClient): # pylint: disable=missing-class-docstring
async def restart(hard: bool = False, **_) -> None:
""" Restart the Userge """
_LOG.info(f"Restarting Userge [{'HARD' if hard else 'SOFT'}]")
if config.HEROKU_APP and hard:
config.HEROKU_APP.restart()
return
restart(hard)

0 comments on commit a114018

Please sign in to comment.