Resetting utils subtree.
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user