From 5c8a54b4b566c8913cea87179054aefb44fd8245 Mon Sep 17 00:00:00 2001 From: Avraham Sakal Date: Sun, 25 Feb 2024 12:08:53 -0500 Subject: [PATCH] add TODOs --- .../ingest-option-quotes-from-polygon-to-clickhouse.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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