introduce back delay
This commit is contained in:
parent
ec48007377
commit
13ab981c59
@ -810,12 +810,14 @@ import pickle
|
||||
def save_games():
|
||||
global save_lock
|
||||
if not save_lock:
|
||||
sio.sleep(2)
|
||||
with open('games.pickle', 'wb') as f:
|
||||
pickle.dump([g for g in games if g.started], f)
|
||||
save_games()
|
||||
|
||||
if __name__ == '__main__':
|
||||
if os.path.exists('games.pickle'):
|
||||
try:
|
||||
with open('games.pickle', 'rb') as file:
|
||||
games = pickle.load(file)
|
||||
for g in games:
|
||||
@ -824,6 +826,8 @@ if __name__ == '__main__':
|
||||
sio.start_background_task(p.disconnect)
|
||||
else:
|
||||
sio.start_background_task(p.bot_spin)
|
||||
except:
|
||||
pass
|
||||
sio.start_background_task(save_games)
|
||||
sio.start_background_task(pool_metrics)
|
||||
eventlet.wsgi.server(eventlet.listen(('', 5001)), CustomProxyFix(app))
|
||||
|
Loading…
Reference in New Issue
Block a user