From 5ad3561dddd0d1ec3e5ed64dc607d5bc72535afc Mon Sep 17 00:00:00 2001 From: Magic <82341152+MagicTheDev@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:15:06 -0500 Subject: [PATCH] fix: ignore empty updates --- bot/clan/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/clan/utils.py b/bot/clan/utils.py index c96f68a..9d476ee 100644 --- a/bot/clan/utils.py +++ b/bot/clan/utils.py @@ -179,8 +179,8 @@ async def raid_weekend_track(clan_tags: List[str], db_client: MongoDatabase, coc json_data = {"type": "raid_state", "clan_tag": current_raid.clan_tag, "old_raid": previous_raid._raw_data, "raid": current_raid._raw_data} producer.send("capital", ujson.dumps(json_data).encode("utf-8"), key=clan_tag.encode("utf-8"), timestamp_ms=int(pend.now(tz=pend.UTC).timestamp() * 1000)) - - await db_client.capital_cache.bulk_write(db_updates, ordered=False) + if db_updates: + await db_client.capital_cache.bulk_write(db_updates, ordered=False)