Cleanup of tenant cache in Utils from DB change in tenants collection
MODIFY
src/storage/mongodb/MongoDBStorageNotification.ts
src/storage/mongodb/MongoDBStorageNotification.ts
@@ -146,6 +146,7 @@ export default class MongoDBStorageNotification {
break;
case 'tenants':
this.centralRestServer.notifyTenant(tenantID, action, { id: documentID });
+ Utils.clearTenants();
break;
case 'transactions':
this.handleTransactionChange(tenantID, documentID, action, changeEvent);

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -462,6 +462,10 @@ export default class Utils {
}
}
+ public static clearTenants(): void {
+ Utils.tenants = [];
+ }
+
public static async checkTenant(tenantID: string): Promise<void> {
if (!tenantID) {
throw new BackendError({

Cleanup of tenant cache in Utils from DB change in tenants collection