正在尝试创建计划程序:
sheduler = AsyncIOScheduler(timezone='Europe/Moscow')
async def thread_maintaining_communication():
print('There')
async def main():
sheduler.add_job(thread_maintaining_communication,"interval", seconds=20)
sheduler.start()
#await bot.infinity_polling(skip_pending=True)
while True:
print('sleep 10 sec')
await asyncio.sleep(10)
asyncio.run(main())
但由于某种我不知道的原因,它不工作。
INFO:apscheduler.scheduler:Adding job tentatively -- it will be properly scheduled when the scheduler starts
INFO:apscheduler.scheduler:Added job "thread_maintaining_communication" to job store "default"
sleep 10 secINFO:apscheduler.scheduler:Scheduler started
sleep 10 sec
sleep 10 sec
sleep 10 sec
1条答案
按热度按时间anauzrmj1#
我得到了一个答案,我希望面对同样问题的人会找到这个主题