Renamed method in lock
MODIFY
src/locking/LockingHelper.ts
src/locking/LockingHelper.ts
@@ -28,8 +28,8 @@ export default class LockingHelper {
return lock;
}
- public static async createAssetLock(tenantID: string): Promise<Lock|null> {
- const lock = LockingManager.createExclusiveLock(tenantID, LockEntity.ASSET, 'asset-consumption');
+ public static async createAssetRetrieveConsumptionsLock(tenantID: string): Promise<Lock|null> {
+ const lock = LockingManager.createExclusiveLock(tenantID, LockEntity.ASSET, 'asset-consumptions');
if (!(await LockingManager.acquire(lock))) {
return null;
}

MODIFY
src/scheduler/tasks/AssetGetConsumptionTask.ts
src/scheduler/tasks/AssetGetConsumptionTask.ts
@@ -29,7 +29,7 @@ export default class AssetGetConsumptionTask extends SchedulerTask {
// Skip execution
return;
}
- const assetLock = await LockingHelper.createAssetLock(tenant.id);
+ const assetLock = await LockingHelper.createAssetRetrieveConsumptionsLock(tenant.id);
if (assetLock) {
try {
// Get dynamic assets only

Renamed method in lock