Mattew S.
Mattew S.
> > In pymongo you can use Transactions within a session. But I don't think it's necessary in this case, because the task was not canceled or got an error....
> > My question is, what is causing the scheduler not to delete the job at the end of its execution and also why did it not decrement the task's...
> allow_transaction Unfortunately this would still be a problem. Since transactions would only work for those who used allow_transaction=True
I found a temporary solution to the problem I'm facing. Just save the jobs that were running when the scheduler stopped and use the .release_job method manually, like this: ```py...
> This is a dangerous looking "fix". You should be aware that I'm currently in the process of refactoring the `stop()` method to allow the scheduler to shut down more...
> The `stop()` method already sets the scheduler state to `stopping` which signals to the background tasks that they should exit their respective loops. Unfortunately, currently there are background tasks...
I just ran the code reproduced above on the master branch. And I found that the problem still persists. **First run logs:** ``` INFO:apscheduler._schedulers.async_:Added new schedule (task='__main__:my_job_func', trigger=IntervalTrigger(hours=1, start_time='2025-04-27 08:01:07.919292-03:00'));...
> Huh...I can't reproduce this with PostgreSQL. Maybe it's the way you're reproducing. Did you use scheduler.stop()?
I was doing some tests on the code, and I realized that the problem is related to the use of the to_thread.run_sync method https://github.com/agronholm/apscheduler/blob/b2f2a3c6b01da31552974399c4a8614cbcf5b3b4/src/apscheduler/datastores/mongodb.py#L791 The operation passed to to_thread.run_sync is...
> Not being executed? You mean it's being cancelled...? Actually, I'm not sure. It seems that to_thread.run_sync does nothing (it doesn't generate an error or anything). I tested it by...