Beispiel #1
0
    def _update_acks_with_status(self, message_ids: set, receiver_id: str,
                                 target_id: str, status: int):
        redis_key_user = RedisKeys.ack_for_user(receiver_id)
        redis_key_room = RedisKeys.ack_for_room(target_id)

        for message_id in message_ids:
            self.redis.hset(redis_key_user, message_id, str(status))
            self.redis.sadd(redis_key_room, message_id)
Beispiel #2
0
 def _get_acks_for(self, message_ids: set, receiver_id: str) -> dict:
     redis_key = RedisKeys.ack_for_user(receiver_id)
     acks = dict()
     for message_id in message_ids:
         ack = self.redis.hget(redis_key, message_id)
         if ack is None:
             continue
         acks[message_ids] = int(float(str(ack, 'utf-8')))
     return acks