是否有一种优雅的方式来处理错误,因为这会掩盖实际的RuntimeError错误
async def clean_up_process_wrapper(app):
while app.is_running:
await(sleep(0.1))
try:
await asyncio.gather(*[system_object['start_cleanup_process'] for system_object in app['State_Machine_Container'].values()])
except RuntimeError:
pass
File "/Users/vchauhan/DEV/dvmt-event-processor/dvmt_event_processor/app.py", line 367, in clean_up_process_wrapper
await asyncio.gather(*[system_object['start_cleanup_process'] for system_object in app['State_Machine_Container'].values()])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/coroutines.py", line 126, in send
return self.gen.send(value)
RuntimeError: cannot reuse already awaited coroutine