From aead526ed3d8c557eaddc3312f161491f9d63754 Mon Sep 17 00:00:00 2001 From: setop Date: Mon, 7 Jul 2025 09:18:02 +0200 Subject: [PATCH] fix ping not reveived --- s6/crond/run | 4 ++-- s6/sqlpage/run | 2 +- scripts/refresh_stats.sh | 9 +++++++++ scripts/runjob.sh | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100755 scripts/refresh_stats.sh diff --git a/s6/crond/run b/s6/crond/run index 1996025..83fd652 100755 --- a/s6/crond/run +++ b/s6/crond/run @@ -3,7 +3,7 @@ # specific to alpine, won't work with debian # place crontab /!\ UTC time -printf "ping=\"curl -fsS -m 10 --retry 5 -o /dev/null ${HC_PING}\"\n${SCHEDULE} /app/scripts/runjob.sh && \${ping} || \${ping}/fail \n" | crontab - +printf "${SCHEDULE} /app/scripts/runjob.sh \n" | crontab - # start cron -crond -f +exec crond -f diff --git a/s6/sqlpage/run b/s6/sqlpage/run index d608e63..43af6e7 100755 --- a/s6/sqlpage/run +++ b/s6/sqlpage/run @@ -1,4 +1,4 @@ #!/bin/sh -eu -/app/bootstrap -c /app/sqlpage/sqlpage.json +exec /app/bootstrap -d /app/sqlpage/ diff --git a/scripts/refresh_stats.sh b/scripts/refresh_stats.sh new file mode 100755 index 0000000..c38a1d7 --- /dev/null +++ b/scripts/refresh_stats.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eu + +CMDD=$(dirname $(realpath $0)) + +cd $(dirname "${CMDD}") # spider must run from app folder + +python -m scrapy runspider src/instances.py + +${CMDD}/refresh_day_stats.sh diff --git a/scripts/runjob.sh b/scripts/runjob.sh index 95ebddc..acfeb0d 100755 --- a/scripts/runjob.sh +++ b/scripts/runjob.sh @@ -1,5 +1,8 @@ #!/bin/sh -eu CMDD=$(dirname $(realpath $0)) -cd $(dirname "${CMDD}") -python -m scrapy runspider src/instances.py + +ping="curl -fsS -m 10 --retry 5 -o /dev/null ${HC_PING}" + +${ping}/start +${CMDD}/refresh_stats.sh && ${ping} || ${ping}/fail