mirror of
https://github.com/rommapp/romm.git
synced 2026-03-03 00:27:01 +00:00
fix(watcher): skip opentelemetry-instrument when OTEL is disabled
When OTEL_SDK_DISABLED=true (set automatically when no OTEL_ env vars are present), the opentelemetry-instrument wrapper does not properly pass through the WATCHFILES_CHANGES environment variable to watcher.py. This causes the filesystem watcher to silently fail - watchfiles detects changes but watcher.py receives an empty WATCHFILES_CHANGES and exits immediately without scheduling any rescans. The fix skips the opentelemetry-instrument wrapper when OTEL is disabled, allowing watchfiles to pass WATCHFILES_CHANGES directly to watcher.py. Fixes automatic rescan on filesystem change for users who don't configure OpenTelemetry (the majority of self-hosted deployments).
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user