Skip to content

Commit 263c585

Browse files
committed
chore: set expiry on latency tests
1 parent 7719dd2 commit 263c585

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/webrtc/webrtc.service.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,17 @@ export class WebrtcService {
9898
isLan: this.isSameLAN(peerConnection),
9999
};
100100

101-
void this.redis.hset(
102-
`latency-test:${sessionId}`,
103-
region.toLowerCase().replace(" ", "_"),
104-
JSON.stringify(results),
105-
);
101+
const latencyTestKey = `latency-test:${sessionId}`;
102+
103+
void this.redis
104+
.multi()
105+
.hset(
106+
latencyTestKey,
107+
region.toLowerCase().replace(" ", "_"),
108+
JSON.stringify(results),
109+
)
110+
.expire(latencyTestKey, 60 * 60)
111+
.exec();
106112

107113
datachannel.sendMessage(
108114
JSON.stringify({

0 commit comments

Comments
 (0)