add SchedulerPauseModel: persist pauses across restarts (#2360, phase 1) - #2532
Open
ebuzerdrmz44 wants to merge 1 commit into
Open
add SchedulerPauseModel: persist pauses across restarts (#2360, phase 1)#2532ebuzerdrmz44 wants to merge 1 commit into
ebuzerdrmz44 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a scheduled backup can't run (repo busy, network gone), the scheduler pauses that profile for up to an hour instead of retrying in a loop. Two problems with that. The schedule page reads "None scheduled" the whole time, so the user has no idea why backups stopped or when they resume. And the pause only lives in memory, so restarting Vorta throws the backoff away and goes straight back at whatever was broken. #2360 lists the second one under the jobs store.
What's in it
SchedulerPauseModel: the profile FK as primary key pluspaused_until, one row per profile._set_pause/_clear_pause/_restore_pauses(), the last dropping anything that expired while Vorta was closedScheduleStatusType.PAUSEDand a "Paused until 14:32" label.Independent of #2530, so it sits on master and the two can land in either order. No migration.
Completes Phase A of the renewed plan.
Calls I'd like you to check
BackupProfileModel.profile_export.pyserialises withmodel_to_dict, so a column would export a stale pause to whoever imports the profile.JobModelrow. You asked for only skipped/interrupted/completed in the store, and a live pause is none of those. Cheap to change now, awkward after a release.paused()had no production caller before this, so persisting the state alone would have bought nothing. Lifts back out if you'd rather it waited for the Jobs view.Known gaps
_record_skipdoesn't cover, and it needs both branches in one tree, so it goes in whichever lands second.unpause()only fires from a successful scheduled backup, and manual backups never connectscheduler.notify. Want a successful manual run to unpause, or an action next to the label?reload_all_timersclears the label back to "None scheduled" even though the pause is still in effect. It comes back on the next reload, andset_timer_for_profilegets restructured in the Phase B split anyway, so I left it.