Skip to content

Commit

Permalink
feat(bin): add mode parameter to agent._restart & and call `agent._…
Browse files Browse the repository at this point in the history
…restart` from `USR1` handler instead of `shikigotchi.restart()`
  • Loading branch information
andatoshiki committed Sep 17, 2024
1 parent 06f336b commit 50382f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/shikigotchi
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def shikigotchi_cli():

def usr1_handler(*unused):
logging.info('Received USR1 singal. Restart process ...')
restart("MANU" if args.do_manual else "AUTO")
agent.restart("MANU" if args.do_manual else "AUTO")

signal.signal(signal.SIGUSR1, usr1_handler)

Expand Down
4 changes: 2 additions & 2 deletions shikigotchi/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def _reboot(self):
self._save_recovery_data()
shikigotchi.reboot()

def _restart(self):
def _restart(self, mode='AUTO'):
self._save_recovery_data()
shikigotchi.restart("AUTO")
shikigotchi.restart(mode)

def _save_recovery_data(self):
logging.warning("writing recovery data to %s ...", RECOVERY_DATA_FILE)
Expand Down

0 comments on commit 50382f4

Please sign in to comment.