We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1f36c74 + d853eea commit e2ee6c2Copy full SHA for e2ee6c2
src/statistics/game-statistics.service.ts
@@ -41,10 +41,15 @@ export class GameStatisticsService implements StatisticsService {
41
private readonly cacheManager: Cache,
42
) {}
43
44
- private getCachedStatistics(period: StatisticsPeriod) {
45
- return this.cacheManager.get<GameStatistics[]>(
+ private async getCachedStatistics(period: StatisticsPeriod) {
+ const cachedStatistics = await this.cacheManager.get<GameStatistics[]>(
46
`trending-games-statistics-${period}`,
47
);
48
+ if (cachedStatistics != undefined && !Array.isArray(cachedStatistics)) {
49
+ return undefined;
50
+ }
51
+
52
+ return cachedStatistics;
53
}
54
55
private setCachedStatistics(
0 commit comments