RuntimeError: There is no current event loop in thread in async + apscheduler

前端 未结 5 1952
我寻月下人不归
我寻月下人不归 2020-12-12 21:00

I have a async function and need to run in with apscheduller every N minutes. There is a python code below

URL_LIST = [\'\',
            \'

        
5条回答
  •  情深已故
    2020-12-12 21:32

    In your def demo_async(urls), try to replace:

    loop = asyncio.get_event_loop()
    

    with:

    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    

提交回复
热议问题