Пример #1
0
 def update(self, room):
     room_key = self._key_room(room.room_id)
     with self._redis_client.pipeline() as p:
         p.hmset(
             room_key,
             to_redis_hash(room),
         )
         p.execute()
Пример #2
0
 def update(self, server):
     server_key = self._key_server(server.name)
     with self._redis_client.pipeline() as p:
         p.hmset(
             server_key,
             to_redis_hash(server),
         )
         if server.expire != 0:
             p.expire(server_key, server.expire)
         p.execute()