Skip to content

Commit 71baecc

Browse files
committed
fix: invalidatecache for all messages for getCategoryTranslations (for translationg external apps)
1 parent e0de91e commit 71baecc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,17 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
647647
);
648648

649649
for (const lang of langsInvolved) {
650-
await this.cache.clear(`${this.resourceConfig.resourceId}:frontend:${lang}`);
650+
const categoriesInvolved = new Set();
651651
for (const { enStr, category } of Object.values(updateStrings)) {
652+
categoriesInvolved.add(category);
652653
await this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}:${enStr}`);
653654
}
655+
for (const category of categoriesInvolved) {
656+
await this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}`);
657+
}
654658
}
655659

656660
return new Set(totalTranslated).size;
657-
658661
}
659662

660663
async processExtractedMessages(adminforth: IAdminForth, filePath: string) {
@@ -703,7 +706,6 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
703706
process.env.HEAVY_DEBUG && console.log('🪲🔔messagesFile add', messagesFile);
704707
this.processExtractedMessages(adminforth, messagesFile);
705708
});
706-
707709
}
708710

709711
validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: AdminForthResource) {

0 commit comments

Comments
 (0)