From 8934e8c3e2482dd7c59917e86526073667e62de8 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 26 Jan 2022 09:31:02 +0000 Subject: [PATCH] continue hour loop on restart --- server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.py b/server.py index 74b1d5d..7644850 100755 --- a/server.py +++ b/server.py @@ -266,6 +266,12 @@ def main(): print('listening on http://%s:%s/' % (ADDRESS, PORT)) app.listen(PORT, ADDRESS) + if os.path.exists('last_run.json'): + with open('last_run.json', 'r') as fd: + data = json.load(fd) + if data and data.get('hour_loop'): + ctl.put(data) + main = IOLoop.instance() try: main.start()