File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -108,15 +108,10 @@ download_db_files() {
108108}
109109
110110sync_latest_db_version () {
111- # FETCH_DB_FILES defaults to true if not set
112- FETCH_DB_FILES=${FETCH_DB_FILES:- true}
113- if [ " ${FETCH_DB_FILES} " = " true" ]; then
114- echo " Downloading initial database files..."
115- while true ; do
116- download_db_files " $TAGINFO_DB_BASE_URL "
117- sleep " $INTERVAL_DOWNLOAD_DATA "
118- done
119- fi
111+ while true ; do
112+ download_db_files " $TAGINFO_DB_BASE_URL "
113+ sleep " $INTERVAL_DOWNLOAD_DATA "
114+ done
120115}
121116
122117start_web () {
@@ -129,8 +124,12 @@ ACTION=$1
129124[[ ! -z ${OVERWRITE_CONFIG_URL} ]] && wget $OVERWRITE_CONFIG_URL -O /usr/src/app/taginfo-config.json
130125updates_source_code
131126if [ " $ACTION " = " web" ]; then
132- start_web &
133- sync_latest_db_version
127+ # Start sync in background if enabled
128+ if [ " ${FETCH_DB_FILES:- true} " = " true" ] && [ ! -z " $TAGINFO_DB_BASE_URL " ]; then
129+ sync_latest_db_version &
130+ fi
131+ # Start web server in foreground (so the loop can detect if it fails)
132+ start_web
134133 elif [ " $ACTION " = " data" ]; then
135134 process_data
136135fi
You can’t perform that action at this time.
0 commit comments