RuntimeError: There is no current event loop in thread in async + apscheduler
问题 I have a async function and need to run in with apscheduller every N minutes. There is a python code below URL_LIST = ['<url1>', '<url2>', '<url2>', ] def demo_async(urls): """Fetch list of web pages asynchronously.""" loop = asyncio.get_event_loop() # event loop future = asyncio.ensure_future(fetch_all(urls)) # tasks to do loop.run_until_complete(future) # loop until done async def fetch_all(urls): tasks = [] # dictionary of start times for each url async with ClientSession() as session: for