feat: implement configurable background jobs and toggle flags
Introduce environment variables to globally and individually control background jobs: - `WARPBOX_JOBS_ENABLED` to toggle all background workers. - `WARPBOX_CLEANUP_ENABLED` to toggle the expired box cleanup job. - `WARPBOX_THUMBNAIL_ENABLED` to toggle the thumbnail generation job. Refactor background tasks into a dedicated `backend/libs/jobs` package, allowing jobs to be registered, scheduled, and conditionally run based on the new configuration flags. Additionally, update the default maximum upload size in `.env.example` to 16GB and document the new settings in the README.
This commit is contained in:
@@ -4,9 +4,12 @@ WARPBOX_ADDR=:8080
|
||||
WARPBOX_BASE_URL=http://localhost:8080
|
||||
WARPBOX_DATA_DIR=./data
|
||||
WARPBOX_ADMIN_TOKEN=change-me
|
||||
WARPBOX_JOBS_ENABLED=true
|
||||
WARPBOX_CLEANUP_ENABLED=true
|
||||
WARPBOX_CLEANUP_EVERY=1h
|
||||
WARPBOX_THUMBNAIL_ENABLED=true
|
||||
WARPBOX_THUMBNAIL_EVERY=1m
|
||||
WARPBOX_MAX_UPLOAD_SIZE_MB=2048
|
||||
WARPBOX_MAX_UPLOAD_SIZE_MB=16384
|
||||
WARPBOX_READ_TIMEOUT=15s
|
||||
WARPBOX_WRITE_TIMEOUT=60s
|
||||
WARPBOX_IDLE_TIMEOUT=120s
|
||||
|
||||
Reference in New Issue
Block a user