feat(sync): enable scheduled asset synchronization mode
This update introduces a persistent background synchronization mode, allowing the external assets container to run continuously and periodically sync albums instead of executing once and exiting. The system now checks a configurable interval, retries on temporary failures, and manages its lifecycle using `time.sleep`. - Added SYNC_INTERVAL_SECONDS configuration for scheduling - Updated compose service to restart automatically and loop indefinitely - Implemented continuous run logic in main function and added corresponding unit tests
This commit is contained in:
+2
-1
@@ -4,7 +4,7 @@ services:
|
||||
context: .
|
||||
image: immich-extern-to-album:local
|
||||
init: true
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
IMMICH_URL: ${IMMICH_URL:?Set IMMICH_URL in .env}
|
||||
IMMICH_API_KEY: ${IMMICH_API_KEY}
|
||||
@@ -14,6 +14,7 @@ services:
|
||||
ALBUM_SEPARATOR: "${ALBUM_SEPARATOR:- - }"
|
||||
PAGE_SIZE: ${PAGE_SIZE:-1000}
|
||||
DRY_RUN: ${DRY_RUN:-false}
|
||||
SYNC_INTERVAL_SECONDS: ${SYNC_INTERVAL_SECONDS:-1800}
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
read_only: true
|
||||
|
||||
Reference in New Issue
Block a user