feat: add TTL to GameSessionStore, replay protection and session cleanup to evaluateAnswer
This commit is contained in:
parent
54705943fa
commit
fdeb769640
6 changed files with 218 additions and 7 deletions
|
|
@ -1,7 +1,11 @@
|
|||
export type GameSessionData = { answers: Map<string, number> };
|
||||
|
||||
export interface GameSessionStore {
|
||||
create(sessionId: string, data: GameSessionData): Promise<void>;
|
||||
create(
|
||||
sessionId: string,
|
||||
data: GameSessionData,
|
||||
ttlMs: number,
|
||||
): Promise<void>;
|
||||
get(sessionId: string): Promise<GameSessionData | null>;
|
||||
delete(sessionId: string): Promise<void>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue