2024-05-09 15:29:45 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
#set -x
|
|
|
|
|
|
2024-08-27 12:16:01 -05:00
|
|
|
. helpers.sh
|
|
|
|
|
|
2024-08-27 12:59:41 -05:00
|
|
|
log "Started"
|
2024-05-09 15:29:45 -05:00
|
|
|
|
2024-05-27 12:10:08 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2024-08-27 12:59:41 -05:00
|
|
|
throw "Child process to get access token reported error. Exiting." err 1
|
2024-05-27 12:10:08 -05:00
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
|
|
|
|
|
jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
|
2024-08-26 15:18:24 -05:00
|
|
|
#The result of XSP is too big causing a problem at the server, therefore limiting to future 400 days and splitting if needed
|
2024-05-09 15:29:45 -05:00
|
|
|
if [[ '$XSP' = ${theSymbol} ]]; then
|
2024-08-13 15:31:47 -05:00
|
|
|
./recordOptionChainSingleSymbolSingleRun.sh -ErrorAsWarning ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+400 days")
|
2024-05-09 15:29:45 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2024-08-27 12:16:01 -05:00
|
|
|
log "falling back to stitching for ${theSymbol}" warning
|
2024-07-17 14:08:55 -05:00
|
|
|
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+400 days")
|
2024-06-20 09:34:11 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
touch temp/hadErrors.$$.tmp
|
|
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
fi
|
2024-05-30 10:53:17 -05:00
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
|
2024-08-09 08:46:53 -05:00
|
|
|
#Default behavior - fall back to stitching on error
|
2024-08-13 15:31:47 -05:00
|
|
|
./recordOptionChainSingleSymbolSingleRun.sh -ErrorAsWarning ${theSymbol}
|
2024-05-17 15:17:09 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2024-08-27 12:16:01 -05:00
|
|
|
log "falling back to stitching for ${theSymbol}" warning
|
2024-08-09 08:46:53 -05:00
|
|
|
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol}
|
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
touch temp/hadErrors.$$.tmp
|
|
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [[ -e temp/hadErrors.$$.tmp ]]; then
|
|
|
|
|
rm temp/hadErrors.$$.tmp
|
2024-10-01 16:28:14 -05:00
|
|
|
curl -s -d "" -X POST "https://deadswitch.kawomi.com/api/v1?topic=trade.schwab.error.recordAllSymbolsSingleRun&secs=1&email=joerg.tretter@gmail.com"
|
2024-05-09 15:29:45 -05:00
|
|
|
fi
|
|
|
|
|
|
2024-08-27 12:16:01 -05:00
|
|
|
log "Finished"
|