fix: lower intervals in raw files 'already downloaded in the last X minutes'

This commit is contained in:
olli 2024-02-07 09:16:46 +01:00
parent 58c1ed1bcf
commit 212cbd771b

View File

@ -6,14 +6,6 @@ function get_asset {
# write asset hist file # write asset hist file
local f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history-raw.csv" local f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history-raw.csv"
if find "${f_ASSET_HIST_FILE}" -mmin -${INTERVAL_MIN} | grep -q "${f_ASSET_HIST_FILE}"
then
g_echo_note "${f_ASSET_HIST_FILE} already downloaded in the last ${INTERVAL_MIN} minutes"
return 0
fi
[ -f "${f_ASSET_HIST_FILE}" ] || echo "Date and Time,Price" >"${f_ASSET_HIST_FILE}" [ -f "${f_ASSET_HIST_FILE}" ] || echo "Date and Time,Price" >"${f_ASSET_HIST_FILE}"
if ! grep -q "^$(echo "${f_timestamp}" | cut -d: -f1,2)" "${f_ASSET_HIST_FILE}" if ! grep -q "^$(echo "${f_timestamp}" | cut -d: -f1,2)" "${f_ASSET_HIST_FILE}"
then then