2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-24 19:04:02 +08:00

gui: do 60114447 properly

This commit is contained in:
Sebastien Bourdeauducq 2016-03-30 01:47:50 +08:00
parent 010c68f0a1
commit 059aa2f83e

View File

@ -71,13 +71,14 @@ class StateManager(TaskObject):
async def _do(self):
try:
while True:
await asyncio.sleep(self.autosave_period)
try:
while True:
await asyncio.sleep(self.autosave_period)
self.save()
finally:
self.save()
except asyncio.CancelledError:
pass
except:
logger.error("Uncaught exception attempting to save state",
exc_info=True)
finally:
self.save()