(feature) add queued backup worker foundation
Move backup execution out of the management command into a reusable backup runner service that can execute an existing BackupRun record. Add queue primitives and a run_pobsync_worker command so manual backup requests can be recorded as queued SQL state and processed outside the web request path. Add a worker Docker service and pobsync worker CLI alias, with tests for queued run creation, worker execution, manual run typing, and command mapping.
This commit is contained in:
@@ -46,3 +46,10 @@ class ConsoleEntrypointTests(SimpleTestCase):
|
||||
|
||||
self.assertEqual(exit_code, 0)
|
||||
execute.assert_called_once_with(["pobsync", "discover_pobsync_snapshots", "--host", "web-01"])
|
||||
|
||||
def test_maps_worker_alias_to_django_command(self) -> None:
|
||||
with patch("pobsync.cli.execute_from_command_line") as execute:
|
||||
exit_code = main(["worker", "--once"])
|
||||
|
||||
self.assertEqual(exit_code, 0)
|
||||
execute.assert_called_once_with(["pobsync", "run_pobsync_worker", "--once"])
|
||||
|
||||
Reference in New Issue
Block a user