diff --git a/.gitignore b/.gitignore index 2677754..03c7819 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,5 @@ dist server/quoteDBs/consolidated.sqlite3 server/quoteDBs/processedDBs server/quoteDBs/*.7z +server/quoteDBs/lastRun.stamp + diff --git a/client/js/orderFrame.js b/client/js/orderFrame.js index ee85315..a0b4289 100644 --- a/client/js/orderFrame.js +++ b/client/js/orderFrame.js @@ -81,7 +81,7 @@ let createOrderFrame=()=>{ } let splitOptionDetails=(input)=>{ - let symbolRest=input.split("_"); + let symbolRest=input.split(/ +|_/); let symbol=symbolRest[0]; let putCall=(symbolRest[1].indexOf("P")>-1)?"P":"C"; diff --git a/server/quoteDBs/continuousOptionTrainerLoad.sh b/server/quoteDBs/continuousOptionTrainerLoad.sh new file mode 100644 index 0000000..1310cd5 --- /dev/null +++ b/server/quoteDBs/continuousOptionTrainerLoad.sh @@ -0,0 +1,34 @@ +#!/bin/bash +while /bin/true; do + (set -e + find /home/schwab/OptionRecorderSchwab/data/ -type f -cnewer lastRun.stamp | grep -v -e '\..TM\.' | sort | while read singleFile; do + echo Processing ${singleFile} | tee | systemd-cat -t "`basename $0`" -p info + symbol=$(pbzip2 -dc "${singleFile}" | jq -r '.symbol' | tr -d '$') + timeStamp=$(basename "${singleFile}" | cut -c 1-19 | tr '_' ":") + insertSQL=$(cat <&1 | systemd-cat -t "`basename $0`" -p debug + + set +e + echo filling symbols table | tee | systemd-cat -t "`basename $0`" -p info + sqlite3 consolidated.sqlite3 'insert INTO Symbols select DISTINCT Symbol from OptionQuotes where OptionQuotes.Symbol not in (select Symbol from Symbols);' + + inotifywait -e create -r /home/schwab/OptionRecorderSchwab/data/ | tee | systemd-cat -t "`basename $0`" -p info + sleep 200 # wait 200 seconds - this should be enough time for all files to finish writing... +done