error for lock acquire fail
MODIFY
src/utils/Cypher.ts
src/utils/Cypher.ts
@@ -143,6 +143,7 @@ export default class Cypher {
// This method will be reused in a Scheduler task that resumes migation
public static async handleCryptoSettingsChange(tenantID: string): Promise<void> {
const createDatabaseLock = LockingManager.createExclusiveLock(tenantID, LockEntity.DATABASE, 'migrate-settings-sensitive-data');
+ try {
if (await LockingManager.acquire(createDatabaseLock)) {
try {
await Cypher.migrate(tenantID);
@@ -162,6 +163,14 @@ export default class Cypher {
await LockingManager.release(createDatabaseLock);
}
}
+ } catch (err) {
+ throw new BackendError({
+ source: Constants.CENTRAL_SERVER,
+ module: MODULE_NAME,
+ method: 'handleCryptoSettingsChange',
+ message: `Sensitive Data migration in progress for tenant with ID: ${tenantID}.`
+ });
+ }
}
public static async migrate(tenantID: string): Promise<void> {

error for lock acquire fail