⚡ Added ttl to game(sessions)
This commit is contained in:
@@ -49,7 +49,7 @@ async def start_quiz(quiz_id: str, user: User = Depends(get_current_user)):
|
||||
game_pin = randint(10000000, 99999999)
|
||||
game = PlayGame(quiz_id=quiz_id, game_pin=str(game_pin), questions=quiz.questions, game_id=uuid.uuid4(),
|
||||
title=quiz.title, description=quiz.description)
|
||||
await redis.set(f"game:{str(game.game_pin)}", (game.json()))
|
||||
await redis.set(f"game:{str(game.game_pin)}", (game.json()), ex=18000)
|
||||
return {**quiz.dict(exclude={"id"}), **game.dict(exclude={"questions"})}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user