diff --git a/server/src/scripts/ingest-option-quotes-from-polygon-to-clickhouse.ts b/server/src/scripts/ingest-option-quotes-from-polygon-to-clickhouse.ts index cb1eefe..86952e2 100644 --- a/server/src/scripts/ingest-option-quotes-from-polygon-to-clickhouse.ts +++ b/server/src/scripts/ingest-option-quotes-from-polygon-to-clickhouse.ts @@ -150,4 +150,12 @@ while((nextUnstartedSymbolAndAsOfDate = await getNextUnstartedSymbolAndAsOfDate( // don't loop again until the queue has less than 50 items; we don't want it to grow in memory without bound: console.log("Waiting till less than 50 in queue"); await q.onSizeLessThan(50); -} \ No newline at end of file +} +// wait until pending queue operations are done: +await q.onSizeLessThan(1); + +/*** TODOs ***/ +/* + + Gracefully recover from errors in individual operations. + + If program stops and is restarted, it should restart anything `pending`: erase existing option contracts for that symbol/asOfDate +*/ \ No newline at end of file