Commit b693e88b authored by nanahira's avatar nanahira

update cache key

parent 9d6114dc
Pipeline #39940 passed with stages
in 4 minutes and 26 seconds
...@@ -40,7 +40,7 @@ class TournamentCache { ...@@ -40,7 +40,7 @@ class TournamentCache {
@CacheKey() @CacheKey()
cacheKey() { cacheKey() {
return `tournament_cache:${this.id}:${this.noAnalytics ? 1 : 0}`; return `tournament_cache2:${this.id}:${this.noAnalytics ? 1 : 0}`;
} }
} }
...@@ -93,7 +93,7 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -93,7 +93,7 @@ export class TournamentService extends CrudService(Tournament, {
Tournament.extraQueryForUser(user, qb, this.entityAliasName); Tournament.extraQueryForUser(user, qb, this.entityAliasName);
qb.select(`${this.entityAliasName}.id`); qb.select(`${this.entityAliasName}.id`);
}); });
const key = `tournament_cache:${id}:${noAnalytics ? 1 : 0}`; const key = `tournament_cache2:${id}:${noAnalytics ? 1 : 0}`;
const res = await this.aragami.cache(TournamentCache, key, async () => { const res = await this.aragami.cache(TournamentCache, key, async () => {
const result = await this.findOne(id); const result = await this.findOne(id);
if (result.data) { if (result.data) {
...@@ -551,6 +551,6 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -551,6 +551,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_cache:${id}:`); await this.aragami.clear(TournamentCache, `tournament_cache2:${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