day fetches 1 minute later

This commit is contained in:
olli 2024-10-21 21:08:36 +02:00
parent c0a3e85888
commit edfa828c2a

View File

@ -31,16 +31,20 @@ do
# Reload Config
. ../../dabo-bot.conf
. ../../dabo-bot.override.conf
# notify failed yahoo downloads
[ "$interval" = "1d" ] && cat FAILED_YAHOO/*USD_* FAILED_YAHOO/*ECONOMY* 2>/dev/null | notify.sh -s "Failed Yahoo downloads"
# notify failed downloads
[ "$interval" = "1d" ] && cat FAILED_*/* 2>/dev/null | notify.sh -s "Failed downloads"
# Timestamp
export f_timestamp=$(g_date_print)
# get candles and indicators
get_ohlcv-candles $interval
[ -n "$seconds" ] && sleeptime=$(( ( ($seconds - $(TZ=UTC printf "%(%s)T") % $seconds) % $seconds + 2 )))
#[[ $interval = 4h ]] && sleeptime=??
[ "$interval" = "1d" ] && sleeptime=$(($(TZ=UTC date +%s -d "tomorrow 0:00") - $(date +%s) +2 ))
[ "$interval" = "1w" ] && sleeptime=$(($(TZ=UTC date +%s -d "next monday 0:00") - $(date +%s) +2 ))
if [ "$interval" = "1d" ]
then
get_marketdata_fear_and_greed_alternativeme
sleeptime=$(($(TZ=UTC date +%s -d "tomorrow 0:01") - $(date +%s) +2 ))
fi
[ "$interval" = "1w" ] && sleeptime=$(($(TZ=UTC date +%s -d "next monday 0:01") - $(date +%s) +2 ))
g_echo_note "Waiting $sleeptime seconds until next run"
sleep $sleeptime
done