Skip to content

Commit 0bb97ee

Browse files
Merge pull request #563 from Alt-Org/bug/player-leaderboard-returns-null-avatar-539
Changed time to live for leaderboards to 3h
2 parents 89d3445 + 4aa64ca commit 0bb97ee

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/leaderboard/leaderboard.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export class LeaderboardService {
1717
private readonly clanService: ClanService,
1818
) {}
1919

20+
/**
21+
* Leaderboard data update interval in second, 3h
22+
*/
23+
private readonly LEADERBOARD_TTL_S = 10800;
24+
2025
/**
2126
* Retrieves the clan leaderboard data.
2227
*
@@ -73,7 +78,11 @@ export class LeaderboardService {
7378
data = await this.processCacheData(model, fetchedData);
7479

7580
// Set the data with 12 hour ttl. The { ttl: number } as any is required to overwrite the default value.
76-
await this.redisService.set(cacheKey, JSON.stringify(data), 60 * 60 * 12);
81+
await this.redisService.set(
82+
cacheKey,
83+
JSON.stringify(data),
84+
this.LEADERBOARD_TTL_S,
85+
);
7786
}
7887

7988
if (reqQuery) {

0 commit comments

Comments
 (0)