Fixing the continuous loader after hidden breaking changes from yesterday

This commit is contained in:
2024-08-21 11:18:47 -05:00
parent 12fd00b3cd
commit 08cd1d870a

View File

@@ -5,24 +5,24 @@ while /bin/true; do
echo Processing ${singleFile} | tee | systemd-cat -t "`basename $0`" -p info
symbol=$(pbzip2 -dc "${singleFile}" | jq -e -r '.symbol' | tr -d '$')
timeStamp=$(basename "${singleFile}" | cut -c 1-19 | tr '_' ":")
insertSQL=$(cat <<EOF
.timeout 10000;
insert into OptionQuotes (
TimeStamp,
Symbol,
Data
) select
datetime('${timeStamp}','utc'),
'${symbol}',
'$(pbzip2 -dc "${singleFile}")'
where not exists (select 1
from OptionQuotes
where TimeStamp=datetime('${timeStamp}','utc')
and Symbol='${symbol}'
);
insertSQL=$(cat <<-EOF
.timeout 10000;
insert into OptionQuotes (
TimeStamp,
Symbol,
Data
) select
datetime('${timeStamp}','utc'),
'${symbol}',
'test'
where not exists (select 1
from OptionQuotes
where TimeStamp=datetime('${timeStamp}','utc')
and Symbol='${symbol}'
);
EOF
)
echo $insertSQL | sqlite3 consolidated.sqlite3
echo "$insertSQL" | sqlite3 consolidated.sqlite3
touch -r "${singleFile}" lastRun.stamp
done) 2>&1 | systemd-cat -t "`basename $0`" -p debug