feat(work): add signed task progress and durable status cards
This commit is contained in:
@@ -298,10 +298,15 @@ def create_app(settings=None, redis=None, platform=None):
|
||||
# No credentials or raw exception text in background logs.
|
||||
pass
|
||||
lifecycle_task = asyncio.create_task(maintenance()) if lifecycle else None
|
||||
async def card_maintenance():
|
||||
while True:
|
||||
await asyncio.sleep(5)
|
||||
with contextlib.suppress(Exception):await deliveries.cards.flush()
|
||||
cards_task=asyncio.create_task(card_maintenance()) if lifecycle and deliveries.cards else None
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
work = [reply_task,sweep_task,*background] + ([lifecycle_task] if lifecycle_task else [])
|
||||
work = [reply_task,sweep_task,*background] + ([lifecycle_task] if lifecycle_task else []) + ([cards_task] if cards_task else [])
|
||||
for task in work:
|
||||
task.cancel()
|
||||
await asyncio.gather(*work, return_exceptions=True)
|
||||
|
||||
Reference in New Issue
Block a user