SyncService

Defined in dccd.daemon.stream_manager

class SyncService(config)[source]

Bases: object

Periodically push the entire local data directory to all remotes.

This is the single point of truth for remote synchronisation. Neither histo jobs nor stream threads push data themselves — they save locally and rely on this service to replicate to remote destinations.

Parameters:
configStorageConfig

Storage configuration (remotes list + sync_interval).

Notes

If config.remotes is empty or config.sync_interval is 0, the service is a no-op and no background thread is started.

start()[source]

Start the background sync thread (idempotent).

stop()[source]

Signal the sync thread to stop at the next interval boundary.

sync_now()[source]

Push local_path to all remotes immediately (blocking).

On success, the timestamp and remote list are recorded in {local_path}/.dccd/last_sync.json so the web UI can display the last sync time without inspecting rclone output.