예제 #1
0
 def has_heartbeat(self, user_id: str) -> bool:
     redis_key = RedisKeys.heartbeat_user(user_id)
     return self.redis.exists(redis_key)
예제 #2
0
 def add_heartbeat(self, user_id: str) -> None:
     redis_key = RedisKeys.heartbeat_user(user_id)
     self.redis.set(redis_key, user_id)
     self.redis.expire(redis_key, ONE_MINUTE)