def update_spawns(self, initial=False):
while True:
try:
await run_threaded(spawns.update)
LOOP.create_task(run_threaded(spawns.pickle))
except OperationalError as e:
self.log.exception('Operational error while trying to update spawns.')
if initial:
raise OperationalError('Could not update spawns, ensure your DB is set up.') from e
await sleep(15, loop=LOOP)
except CancelledError:
raise
except Exception as e:
self.log.exception('A wild {} appeared while updating spawns!', e.__class__.__name__)
await sleep(15, loop=LOOP)
else:
break
评论列表
文章目录