Resetting utils subtree.

This commit is contained in:
2025-02-04 17:56:45 +05:30
parent c5c8e34d5a
commit 08e1d153bb
205 changed files with 42 additions and 144963 deletions
+14 -5
View File
@@ -159,10 +159,17 @@ async def save_ticks(ticks: List[dict]):
tick["exchgTs"] = date_time.parse_date_time(tick["exchgTs"], timezone = date_time.TIMEZONE_UTC)
# Save the ticks:
inserted_ids = await data_mongo.insert_many(
collection = "__cold_zerodhaTicks",
documents = ticks
)
tasks = [
data_mongo.insert_many(collection = "__hot_zerodhaTicks", documents = ticks),
data_mongo.insert_many(collection = "__cold_zerodhaTicks", documents = ticks)
]
results = await asyncio.gather(*tasks)
# # Save the ticks:
# inserted_ids = await data_mongo.insert_many(
# collection = "__cold_zerodhaTicks",
# documents = ticks
# )
# Send out the alert if needed:
ticks_since_telegram += len(ticks)
@@ -205,7 +212,9 @@ async def ticks_from_kafka(
)
# If there are no updates to give:
if not messages: continue
if not messages:
no_context_printer("No ticks.")
continue
# We extract all the ticks from the Kafka messages:
ticks = []