Skip to content

Commit 5544c91

Browse files
committed
Fetch data if requiere - taginfo
1 parent e14760a commit 5544c91

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

images/taginfo/start.sh

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

110110
sync_latest_db_version() {
111-
while true; do
112-
sleep "$INTERVAL_DOWNLOAD_DATA"
113-
download_db_files "$TAGINFO_DB_BASE_URL"
114-
done
115-
}
116-
117-
start_web() {
118-
echo "Start...Taginfo web service"
119111
# FETCH_DB_FILES defaults to true if not set
120112
FETCH_DB_FILES=${FETCH_DB_FILES:-true}
121113
if [ "${FETCH_DB_FILES}" = "true" ]; then
122114
echo "Downloading initial database files..."
123-
download_db_files "$TAGINFO_DB_BASE_URL"
115+
while true; do
116+
download_db_files "$TAGINFO_DB_BASE_URL"
117+
sleep "$INTERVAL_DOWNLOAD_DATA"
118+
done
124119
fi
120+
}
121+
122+
start_web() {
123+
echo "Start...Taginfo web service"
125124
cd $WORKDIR/taginfo/web && ./taginfo.rb
126125
}
127126

@@ -130,7 +129,8 @@ ACTION=$1
130129
[[ ! -z ${OVERWRITE_CONFIG_URL} ]] && wget $OVERWRITE_CONFIG_URL -O /usr/src/app/taginfo-config.json
131130
updates_source_code
132131
if [ "$ACTION" = "web" ]; then
133-
start_web
132+
start_web &
133+
sync_latest_db_version
134134
elif [ "$ACTION" = "data" ]; then
135135
process_data
136136
fi

0 commit comments

Comments
 (0)