Skip to content

Commit 6eb40e7

Browse files
committed
Update config
1 parent 5544c91 commit 6eb40e7

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

images/taginfo/start.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,10 @@ download_db_files() {
108108
}
109109

110110
sync_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

122117
start_web() {
@@ -129,8 +124,12 @@ ACTION=$1
129124
[[ ! -z ${OVERWRITE_CONFIG_URL} ]] && wget $OVERWRITE_CONFIG_URL -O /usr/src/app/taginfo-config.json
130125
updates_source_code
131126
if [ "$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
136135
fi

0 commit comments

Comments
 (0)