refactor(config): Set correct default sync interval and documentation

The default synchronization interval has been updated across the application to reflect a standard 30-minute delay (1800 seconds). This change updates both the source code configuration and the README documentation, ensuring that users rely on the accurate default value when no environment variable is provided.

- Updated SYNC_INTERVAL_SECONDS default in src/main.py
- Clarified single-run behavior in README.md
This commit is contained in:
2026-07-23 14:25:03 +02:00
parent 7a43db8dd8
commit a51479b599
3 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ Optional environment variables:
- `ALBUM_SEPARATOR`: Separator for `relative` mode; defaults to ` - ` - `ALBUM_SEPARATOR`: Separator for `relative` mode; defaults to ` - `
- `PAGE_SIZE`: Immich search page size; defaults to `1000` - `PAGE_SIZE`: Immich search page size; defaults to `1000`
- `DRY_RUN`: Set to `true` to log planned work without changing albums - `DRY_RUN`: Set to `true` to log planned work without changing albums
- `SYNC_INTERVAL_SECONDS`: Delay between runs; `0` runs once and exits. - `SYNC_INTERVAL_SECONDS`: Delay between runs; defaults to `1800` seconds
Docker Compose defaults to `1800` seconds (30 minutes) (30 minutes). Set it to `0` for a single run
Run the script after Immich has scanned the external library: Run the script after Immich has scanned the external library:
+1 -1
View File
@@ -33,7 +33,7 @@ ALBUM_SEPARATOR = os.environ.get("ALBUM_SEPARATOR", " - ")
PAGE_SIZE = int(os.environ.get("PAGE_SIZE", "1000")) PAGE_SIZE = int(os.environ.get("PAGE_SIZE", "1000"))
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true" DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
SYNC_INTERVAL_SECONDS = int( SYNC_INTERVAL_SECONDS = int(
os.environ.get("SYNC_INTERVAL_SECONDS", "0") os.environ.get("SYNC_INTERVAL_SECONDS", "1800")
) )
logging.basicConfig( logging.basicConfig(
+4
View File
@@ -142,6 +142,10 @@ class SynchronizationTests(unittest.TestCase):
album_sync, album_sync,
"ALBUM_MODE", "ALBUM_MODE",
"root", "root",
), patch.object(
album_sync,
"SYNC_INTERVAL_SECONDS",
0,
), patch.object( ), patch.object(
album_sync, album_sync,
"check_configuration", "check_configuration",