Commit 31672c79 authored by nanahira's avatar nanahira

Update src/tournament/tournament.service.ts

parent a2c8e1ec
Pipeline #40062 passed with stages
in 2 minutes and 6 seconds
...@@ -40,7 +40,7 @@ class TournamentCache { ...@@ -40,7 +40,7 @@ class TournamentCache {
@CacheKey() @CacheKey()
cacheKey() { cacheKey() {
return `tournament_cache2:${this.id}:${this.noAnalytics ? 1 : 0}`; return `tournament_cache3:${this.id}:${this.noAnalytics ? 1 : 0}`;
} }
} }
...@@ -107,7 +107,7 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -107,7 +107,7 @@ export class TournamentService extends CrudService(Tournament, {
cache.tournament = result.data; cache.tournament = result.data;
return cache; return cache;
}; };
const key = `tournament_cache2:${id}:${noAnalytics ? 1 : 0}`; const key = `tournament_cache3:${id}:${noAnalytics ? 1 : 0}`;
const res = await (noCache ? fetchTournament() : this.aragami.cache(TournamentCache, key, fetchTournament)); const res = await (noCache ? fetchTournament() : this.aragami.cache(TournamentCache, key, fetchTournament));
const tournament = res.tournament; const tournament = res.tournament;
tournament.wipeDeckBuf(user); tournament.wipeDeckBuf(user);
...@@ -555,6 +555,6 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -555,6 +555,6 @@ export class TournamentService extends CrudService(Tournament, {
async clearTournamentCache(id: number) { async clearTournamentCache(id: number) {
if (!id) return; if (!id) return;
this.log.log(`Clearing cache for tournament ${id}`); this.log.log(`Clearing cache for tournament ${id}`);
await this.aragami.clear(TournamentCache, `tournament_cache2:${id}:`); await this.aragami.clear(TournamentCache, `tournament_cache3:${id}:`);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment