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

前端 未结 5 1946
我寻月下人不归
我寻月下人不归 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条回答
  •  萌比男神i
    2020-12-12 21:21

    Just pass fetch_all to scheduler.add_job() directly. The asyncio scheduler supports coroutine functions as job targets.

    If the target callable is not a coroutine function, it will be run in a worker thread (due to historical reasons), hence the exception.

提交回复
热议问题