Make !update not pull if a game is running
The reason we defer pulling is because if an error happens before restarting, the line numbers in the traceback may not reflect the actual line numbers since the code has changed.
This commit is contained in:
parent
946e84cbd3
commit
6ac05fb3e6
@ -7297,6 +7297,16 @@ def fpull(cli, nick, chan, rest):
|
||||
def update(cli, nick, chan, rest):
|
||||
"""Pulls from the repository and restarts the bot to update it."""
|
||||
|
||||
force = (rest.strip() == "-force")
|
||||
|
||||
if var.PHASE in var.GAME_PHASES:
|
||||
if var.PHASE == "join" or force:
|
||||
stop_game(cli, log=False)
|
||||
else:
|
||||
reply(cli, nick, chan, messages["stop_bot_ingame_safeguard"].format(
|
||||
what="restart", cmd="update", prefix=botconfig.CMD_CHAR), private=True)
|
||||
return
|
||||
|
||||
if update.aftergame:
|
||||
# Display "Scheduled restart" instead of "Forced restart" when called with !faftergame
|
||||
restart_program.aftergame = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user