@punks/backend-entity-manager 0.0.261 → 0.0.263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/services/operations/operation-lock.service.d.ts +1 -0
- package/dist/esm/index.js +10 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/services/operations/operation-lock.service.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -21865,9 +21865,11 @@ function differenceInMinutes(dateLeft, dateRight, options) {
|
|
|
21865
21865
|
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
|
21866
21866
|
}
|
|
21867
21867
|
|
|
21868
|
-
|
|
21868
|
+
var OperationLockService_1;
|
|
21869
|
+
exports.OperationLockService = OperationLockService_1 = class OperationLockService {
|
|
21869
21870
|
constructor(operations) {
|
|
21870
21871
|
this.operations = operations;
|
|
21872
|
+
this.logger = backendCore.Log.getLogger(OperationLockService_1.name);
|
|
21871
21873
|
this.executeExclusive = async (input) => {
|
|
21872
21874
|
const lock = await this.operations.acquire({
|
|
21873
21875
|
lockUid: input.lockUid,
|
|
@@ -21905,9 +21907,15 @@ exports.OperationLockService = class OperationLockService {
|
|
|
21905
21907
|
this.isLockExpired = (item, refDate, timeoutMinutes) => {
|
|
21906
21908
|
return differenceInMinutes(refDate, item.createdOn) > timeoutMinutes;
|
|
21907
21909
|
};
|
|
21910
|
+
if (!operations) {
|
|
21911
|
+
this.logger.warn(`Cannot resolve locks repository: ${getEntityManagerProviderToken("OperationsLockRepository")}`);
|
|
21912
|
+
}
|
|
21913
|
+
else {
|
|
21914
|
+
this.logger.info(`Resolved locks repository: ${getEntityManagerProviderToken("OperationsLockRepository")}`);
|
|
21915
|
+
}
|
|
21908
21916
|
}
|
|
21909
21917
|
};
|
|
21910
|
-
exports.OperationLockService = __decorate([
|
|
21918
|
+
exports.OperationLockService = OperationLockService_1 = __decorate([
|
|
21911
21919
|
common.Injectable(),
|
|
21912
21920
|
__param(0, common.Optional()),
|
|
21913
21921
|
__param(0, common.Inject(getEntityManagerProviderToken("OperationsLockRepository"))),
|