There was an error while loading. Please reload this page.
1 parent d20bdab commit 0aa3d99Copy full SHA for 0aa3d99
1 file changed
api/pubsub_mongo.py
@@ -283,10 +283,10 @@ async def _update_subscriber_state(
283
):
284
"""Update subscriber's last_event_id and last_poll"""
285
col = self._mongo_db[self.SUBSCRIBER_STATE_COLLECTION]
286
- update = {"last_event_id": last_event_id}
+ update = {"$max": {"last_event_id": last_event_id}}
287
if last_poll:
288
- update["last_poll"] = last_poll
289
- await col.update_one({"subscriber_id": subscriber_id}, {"$set": update})
+ update["$set"] = {"last_poll": last_poll}
+ await col.update_one({"subscriber_id": subscriber_id}, update)
290
291
@staticmethod
292
def _decode_redis_message(msg: Dict) -> Dict:
0 commit comments