add JobModel: persistent scheduler job store (#2360, phase 1)#2530
Draft
ebuzerdrmz44 wants to merge 1 commit into
Draft
add JobModel: persistent scheduler job store (#2360, phase 1)#2530ebuzerdrmz44 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
First PR of the scheduler refactor (#2360), which I'm splitting into small stacked PRs (full breakdown is on the issue). This one just adds
JobModel; nothing reads or writes it yet.No migration needed.
connection.pybuilds tables withcreate_tables(), which is safe by default, so the table shows up on both fresh and existing DBs.The idea:
JobModeltracks a job's lifecycle and intent (scheduled, running, done, skipped, interrupted). When a job actually runs it links to the matchingEventLogModelrow throughevent_log, so I'm not duplicating start/end/returncode across two tables.EventLogModelstays the record of what executed, andJobModeladds the intent plus the things that never produce a log line, like a job that got skipped.A few schema questions before I build on it. The rest of the plan doesn't depend on these, but this table's shape does:
set_timer_for_profile. I lean toward persisting skipped and interrupted jobs while leaving next-run derivation as is.EventLogModeluses strings, so its rows survive a profile being deleted. Same for the jobs history, or is a FK fine here?@m3nu If you'd rather this not merge as a bare model, I can fold in the first consumer (skip-reason recording) before then.