(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:
2026-05-19 13:00:12 +02:00
parent aea22597ba
commit fe8e65e12e
9 changed files with 361 additions and 92 deletions

View File

@@ -125,7 +125,7 @@ This starts Django on:
Run the scheduler alongside the web admin:
```
docker compose up --build web scheduler
docker compose up --build web scheduler worker
```
The container persists `/opt/pobsync` and the SQLite database in Docker volumes.
@@ -133,7 +133,7 @@ Backup data is mounted at `/backups` inside the containers. By default this uses
Override it with `POBSYNC_BACKUP_ROOT`:
```
POBSYNC_BACKUP_ROOT=/mnt/backups/pobsync docker compose up --build web scheduler
POBSYNC_BACKUP_ROOT=/mnt/backups/pobsync docker compose up --build web scheduler worker
```
In the Django global config, set the backup root to `/backups` when running in Docker. For local, non-Docker use,
@@ -148,7 +148,7 @@ docker compose --profile mariadb up --build web-mariadb
With the scheduler:
```
docker compose --profile mariadb up --build web-mariadb scheduler-mariadb
docker compose --profile mariadb up --build web-mariadb scheduler-mariadb worker-mariadb
```
SQLite remains the default because it is enough for a single backup server and keeps deployment simple.