Add persistent scheduler job store for scheduled backups#2438
Open
CodeLoopdroid wants to merge 1 commit intoborgbase:masterfrom
Open
Add persistent scheduler job store for scheduled backups#2438CodeLoopdroid wants to merge 1 commit intoborgbase:masterfrom
CodeLoopdroid wants to merge 1 commit intoborgbase:masterfrom
Conversation
# Conflicts: # src/vorta/scheduler.py
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
This PR adds an initial persistent jobs store implementation for scheduled backups as part of the scheduler refactor.
It introduces a new
JobModelto persist scheduled backup intent before execution begins, records skipped scheduled jobs with reasons, and links execution results back to the scheduled job record. The goal here is to establish the database-backed foundation for the larger scheduler refactor without trying to solve the full issue in one PR.This change is intentionally scoped to the scheduled backup path only. It does not yet include the Jobs UI, post-backup child jobs, or full crash recovery and restart reconciliation.
Related Issue
Part of #2360
Motivation and Context
At the moment,
EventLogModelonly tracks executed jobs, while pending scheduled jobs and pause-related state are kept in memory. That means scheduled intent is lost on restart and skipped scheduled jobs do not leave behind a durable audit trail.This PR starts solving that problem by storing scheduled backup jobs in the database and tracking their lifecycle from scheduling to execution or skip. It is meant to be a focused first step toward the broader scheduler refactor described in #2360.
How Has This Been Tested?
I tested this change with targeted unit tests covering both the existing scheduler behavior and the new jobs-store lifecycle.
Test command used:
py -3.11 -m pytest tests/unit/test_job_store.py tests/unit/test_scheduler.py -q -p no:cacheprovider`
Test result:
The tests cover:
Screenshots (if appropriate):
Not applicable.
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.