diff --git a/docker/init_scripts/init b/docker/init_scripts/init index 88444ee4d..34ea60ec8 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -219,10 +219,19 @@ start_bin_rq_worker() { start_bin_watcher() { info_log "Starting watcher" - watchfiles \ - --target-type command \ - "opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}watcher' python3 watcher.py" \ - /romm/library & + if [[ ${OTEL_SDK_DISABLED:-false} == "true" ]]; then + # Skip opentelemetry-instrument when OTEL is disabled to ensure + # WATCHFILES_CHANGES env var is properly passed to watcher.py + watchfiles \ + --target-type command \ + "python3 watcher.py" \ + /romm/library & + else + watchfiles \ + --target-type command \ + "opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}watcher' python3 watcher.py" \ + /romm/library & + fi WATCHER_PID=$! echo "${WATCHER_PID}" >/tmp/watcher.pid }