def get_last_read_timestamp(self, room_id: str, user_id: str) -> int: timestamp = self.redis.hget(RedisKeys.last_read(room_id), user_id) if timestamp is None: return None return int(str(timestamp, 'utf-8'))
def update_last_read_for(self, users: set, room_id: str, time_stamp: int) -> None: self.get_room_name(room_id) redis_key = RedisKeys.last_read(room_id) for user_id in users: self.redis.hset(redis_key, user_id, time_stamp)