-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove APScheduler and dateutils dependencies #1086
Conversation
0f86b1b
to
b6f0887
Compare
77ee384
to
eaabef8
Compare
Hello @m3nu , |
The cancel button doesnt work, even if I launch manually a backup. I tried to understand. THe method cancel_all_jobs is not called (you can set DEBUG to true). |
Also noticed that we don't really use many features from python-datutils. So might as well toss that too. Also noticed that we never removed old deps from Flatpak. Hope that's ok for Flatpak, @Hofer-Julian . |
Thanks. Checking this out now. |
This is fixed and pushed. |
Cancel button works now <33
EDIT: |
4df1e36
to
f200637
Compare
Investigating the 2-profile issue now. I should point out that I'm using the previous backup time including seconds. So the backup may start at 20:15:58, which could be confusing because we show the "Next Time" just as minutes. Should I drop seconds from the next scheduled job? |
No, there were 2 bugs in your observation:
|
Yes i notice that. It is confusing, particularly if you test scheduler as a user for the first time. If you can, you should drop secs |
Is the new scheduler capable of restarting a backup in case of power failure on the next boot ? |
Yeah, that part sucks a bit at the moment. You use this flatpak folder only for local development, there is a duplicated one on the flathub repo. Since I seem to be the only one who used that we might want to remove it here until we find another use case again. |
It's only looking at the event log time to determine the last backup for a profile. This log is saved when the job starts. So if power fails, it wouldn't catch up with this missed backup. To solve this, we would need to log the at job at the end instead. Relevant line: https://github.com/borgbase/vorta/pull/1086/files#diff-5aac1bfe6bba70f21fbb7569b769d9a92ff1ecc74e4cf1322bd4894f3f068c1fR209 EDIT: Just noticed that the return code is only added after the job is complete. So I could filter by only adding successful jobs. This would make it catch up with jobs that started, but never finished. |
Ok it was just to known because during multiple queues implementation, I planned to save running Job in db and remove them at the end of their execution. I will test more Vorta today with the new scheduler ;) |
e4d2f36
to
b8a4c13
Compare
I added a new field Next issue I though of: How can the scheduler skip profiles that already have a backup running in the background? Would your queue take care of that? E.g. what happens if my backup takes 1h and I schedule them for every 5min? Is this something we need to consider? |
Apart from the issue with long-running backups jobs, I'm happy with the current implementation. Will wait for your guidance on this last question. |
I thought about the same thing and the problem is that vorta works at profile level and jobs manager at repository level just like borg. Its easy to limit at only one backup per repos but it is not what the vorta user expect (a repo can be use by 2 different is profile). I can add a control at profile level in the jobs manager. In any case, I think it is the role of the jobs managet to skip a backup. So it can wait another PR (Currently, if a user run a backup every 5 mn on a repo, it will be enqueue and run later even if the backup takes 1 hour) |
Would be good if you can set it to skip same repos. It's fine if it's at the repo level instead of profile level. That makes even more sense from Borg's point of view. So I'll merge this on Tuesday or so and then you can adjust the job scheduler to skip duplicates. Thanks for the feedback and reviewing! |
My second shot at replacing APScheduler. Thanks to the work by @bastiencyr, it got simpler because the scheduler doesn't need its own thread.
Fixes #862, fixes #263, fixes #1083, fixes #1088, replaces #551 (PR), replaces #908 (PR)