File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929echo " [1/3] Pulling latest GHCR image..."
3030docker compose --project-directory " ${PROJECT_ROOT} " " ${ENV_ARGS[@]} " -f " ${COMPOSE_FILE} " pull
3131
32- # Check if worker container is running and an active calculation is in progress
32+ # Check if worker container exists and an active calculation is in progress
3333CONTAINER_NAME=" devimpact-leaderboard-cron"
34- if docker ps --format ' {{.Names}}' | grep -q " ^${CONTAINER_NAME} $" ; then
34+ if docker ps -a - -format ' {{.Names}}' | grep -q " ^${CONTAINER_NAME} $" ; then
3535 echo " [2/3] Checking for active leaderboard calculation..."
3636 while docker exec " ${CONTAINER_NAME} " pgrep -f " calculate-next-country" > /dev/null 2>&1 || \
37- docker exec " ${CONTAINER_NAME} " sh -c ' ps aux | grep -v grep | grep -q "calculate-next-country"' ; do
37+ docker exec " ${CONTAINER_NAME} " sh -c ' ps aux | grep -v grep | grep -q "calculate-next-country"' > /dev/null 2>&1 ; do
3838 echo " >> A leaderboard calculation job is currently running. Waiting for it to finish..."
3939 sleep 10
4040 done
4141 echo " >> No active calculation running (or active calculation completed)."
42+ echo " >> Removing previous container to prevent name conflicts..."
43+ docker stop " ${CONTAINER_NAME} " > /dev/null 2>&1 || true
44+ docker rm -f " ${CONTAINER_NAME} " > /dev/null 2>&1 || true
4245else
4346 echo " [2/3] Worker container is not running yet."
4447fi
Original file line number Diff line number Diff line change 1+ name : devimpact-leaderboard
2+
13services :
24 leaderboard-cron :
35 image : ${LEADERBOARD_IMAGE:-ghcr.io/o2sa/devimpact-leaderboard:latest}
You can’t perform that action at this time.
0 commit comments