@anchan828/nest-redlock 0.0.7 → 0.0.8
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RedisRedlock = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
+
const redis_redlock_constants_1 = require("./redis-redlock.constants");
|
|
5
6
|
const redis_redlock_service_1 = require("./redis-redlock.service");
|
|
6
7
|
function RedisRedlock(resource, duration, settings = {}) {
|
|
7
8
|
const injectRedisRedlockService = (0, common_1.Inject)(redis_redlock_service_1.RedisRedlockService);
|
|
@@ -14,7 +15,7 @@ function RedisRedlock(resource, duration, settings = {}) {
|
|
|
14
15
|
const descriptorThis = this;
|
|
15
16
|
const redisRedlockService = descriptorThis[serviceSymbol];
|
|
16
17
|
const resources = getResources(resource, descriptorThis, args);
|
|
17
|
-
return await redisRedlockService.using(resources, duration || redisRedlockService.options
|
|
18
|
+
return await redisRedlockService.using(resources, duration || redisRedlockService.options?.duration || redis_redlock_constants_1.DEFAULT_DURATION, settings, async (signal) => {
|
|
18
19
|
const result = await originalMethod.apply(descriptorThis, args);
|
|
19
20
|
if (signal.aborted) {
|
|
20
21
|
throw signal.error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-redlock",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "This is a [Nest](https://github.com/nestjs/nest) implementation of the redlock algorithm for distributed redis locks.",
|
|
5
5
|
"homepage": "https://github.com/anchan828/nest-redlock#readme",
|
|
6
6
|
"bugs": {
|