Repository navigation
fix: remove logic about schedule deletion - #95
Conversation
If True, startup no longer deletes and re-creates schedules from broker tasks, so schedules added in a previous run are kept.
|
@SnakeOilSalesman I think we should completely remove the logic for finding schedules by label. There’s another source that should do that - LabelScheduleSource. And, consequently, we should simply never delete any schedules that are already in the database. Because people mostly use postgres schedule source for dynamic scheduls that should live through an app restarts. Maybe we can implement this logic in this MR? |
Sure, I'll take a look into it and will get back soon. |
…ed schedule extraction and broker parameter (danfimov#65)
|
@danfimov I pushed the changes. Do I get your idea right? BTW, I noticed, that you haven't been updating version field in pyroject.toml. Just wanted to inform you. |
|
Looks good |
By default every startup the schedule source deletes all stored schedules and re-creates them from schedules declared in broker tasks, so schedules added at runtime (via add_schedule) are lost on restart.
This PR adds a keep_schedules: bool = False flag to all schedule sources (asyncpg, psqlpy, psycopg, aiopg). When True, startup only ensures the table exists and keeps all previously stored schedules as they are.
All checks pass: ruff, mypy, full test suite (278 tests).