def set_round_start(r: int) -> None: """Set start time for round as str.""" cur_time = int(time.time()) with utils.redis_pipeline(transaction=False) as pipe: pipe.set(CacheKeys.round_start(r), cur_time).execute()
def get_round_start(r: int) -> int: """Get start time for round as unix timestamp.""" with utils.redis_pipeline(transaction=False) as pipe: start_time, = pipe.get(CacheKeys.round_start(r)).execute() return int(start_time or 0)