.
Size: a a a
.
B
B
B
.
Z
async def test():
for i in range(5):
print(i)
await asyncio.sleep(5)
async def main():
scheduler = apscheduler.schedulers.asyncio.AsyncIOScheduler()
job = scheduler.add_job(test, id='test_id', replace_existing=True)
print('start')
scheduler.start()
# scheduler.print_jobs()
await asyncio.sleep(2)
print('pause')
job.pause()
# scheduler.pause_job(job_id='test_id')
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
Во всех вариантах выдаёт:apscheduler.jobstores.base.JobLookupError: 'No job by the id of test_id was found'
Или для таких целей дефолтное хранилище не подходит?D
$
$
D
N
async def test():
for i in range(5):
print(i)
await asyncio.sleep(5)
async def main():
scheduler = apscheduler.schedulers.asyncio.AsyncIOScheduler()
job = scheduler.add_job(test, id='test_id', replace_existing=True)
print('start')
scheduler.start()
# scheduler.print_jobs()
await asyncio.sleep(2)
print('pause')
job.pause()
# scheduler.pause_job(job_id='test_id')
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
Во всех вариантах выдаёт:apscheduler.jobstores.base.JobLookupError: 'No job by the id of test_id was found'
Или для таких целей дефолтное хранилище не подходит?$
D
ЕП
D
Z
job.pause()
или scheduler.pause_job(job_id)
D
async def test():
for i in range(5):
print(i)
await asyncio.sleep(5)
async def main():
scheduler = apscheduler.schedulers.asyncio.AsyncIOScheduler()
job = scheduler.add_job(test, id='test_id', replace_existing=True)
print('start')
scheduler.start()
# scheduler.print_jobs()
await asyncio.sleep(2)
print('pause')
job.pause()
# scheduler.pause_job(job_id='test_id')
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
Во всех вариантах выдаёт:apscheduler.jobstores.base.JobLookupError: 'No job by the id of test_id was found'
Или для таких целей дефолтное хранилище не подходит?Z
ЕП
bot = Bot(token="", validate_token=False)
, как у тебя, aiogram ругается: Traceback (most recent call last):
File "...", line 6, in <module>
bot = Bot(token="", validate_token=False)
File "...", line 64, in __init__
self.id = int(token.split(sep=':')[0])
ValueError: invalid literal for int() with base 10: ''