Skip to content

Commit

Permalink
Updata start taginfo script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Apr 5, 2024
1 parent fb2d63a commit 5f6d1ec
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions images/taginfo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,23 @@ update() {
}

start_web() {
echo "Start...Taginfo web service"
cd $WORKDIR/taginfo/web && bundle exec rackup --host 0.0.0.0 -p 80
}

continuous_update() {
while true; do
update
sleep $TIME_UPDATE_INTERVAL
echo "Start...Taginfo web service"
NUM_DB_FILES=$(ls $DATA_DIR/*.db | wc -l)
if [ $NUM_DB_FILES -ge 7 ]; then
cd /apps/taginfo/web && bundle exec rackup --host 0.0.0.0 -p 80 &
break
fi
sleep 60
done
}

main() {

ACTION=$1
if [ "$ACTION" = "web" ]; then
start_web
elif [ "$ACTION" = "data" ]; then
set_taginfo_config
updates_source_code
# Check if db files are store in the $DATA_DIR in order to start the service or start procesing the file
NUM_DB_FILES=$(ls $DATA_DIR/*.db | wc -l)
if [ $NUM_DB_FILES -lt 7 ]; then
update
fi
start_web &
continuous_update
}
main
update
fi

0 comments on commit 5f6d1ec

Please sign in to comment.