Skip to content

Commit

Permalink
fix(api:moderation): cleanup all cache on report
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshyx committed May 25, 2022
1 parent 51dcd7e commit d52a2a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion api/hub/src/datasources/moderation-decision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ class ModerationDecisionAPI extends DataSource {
) {
const decisions = await this.listDecisions(delisted, moderated, offset, limit);
const list = [];
console.info('decisions', decisions);
for (const decision of decisions.results) {
// get the full data for each decision
const decisionContent = await this.getFinalDecision(
Expand Down
4 changes: 4 additions & 0 deletions api/hub/src/datasources/moderation-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ class ModerationReportAPI extends DataSource {
collection: 'ModerationDecisions',
});
// clear cache

await queryCache.del(decisionsAPI.getDecisionCacheKey(contentID));
await queryCache.del(decisionsAPI.getModeratedDecisionCacheKey(contentID));
await queryCache.del(decisionsAPI.getCountersCacheKey());
await queryCache.del(decisionsAPI.getModeratedListCacheKey());
await queryCache.del(decisionsAPI.getPendingListCacheKey());
}
}
Expand Down

0 comments on commit d52a2a9

Please sign in to comment.