dont start the watcher.py when we disable rescan on change

This commit is contained in:
Lukas Wingerberg
2023-11-02 10:53:52 +01:00
parent 97f633f608
commit 51c67a4e5d

View File

@@ -8,6 +8,9 @@ shopt -s inherit_errexit # inherit errexit
# use virtualenvs
source /backend/bin/activate
# make it possible to disable the inotify watcher process
ENABLE_RESCAN_ON_FILESYSTEM_CHANGE="${ENABLE_RESCAN_ON_FILESYSTEM_CHANGE:="true"}"
# Set redis to false if not set by docker env
ENABLE_EXPERIMENTAL_REDIS="${ENABLE_EXPERIMENTAL_REDIS:="false"}"
@@ -112,8 +115,12 @@ while true; do
# Start uvicorn if we dont have a corresponding PID file
watchdog_process_pid bin uvicorn
# Start watcher if we dont have a corresponding PID file
watchdog_process_pid python watcher
# Start background worker processes when we have a REDIS configured
# ENABLE_EXPERIMENTAL_REDIS is defaulted to false, unless its set from our docker env
if [[ ${ENABLE_RESCAN_ON_FILESYSTEM_CHANGE} == "true" ]]; then
# Start watcher if we dont have a corresponding PID file
watchdog_process_pid python watcher
fi
# Start background worker processes when we have a REDIS configured
# ENABLE_EXPERIMENTAL_REDIS is defaulted to false, unless its set from our docker env