@anchan828/nest-redlock 0.1.14 → 0.1.15
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.
|
@@ -16,11 +16,11 @@ function Redlock(key, duration, settings = {}) {
|
|
|
16
16
|
const redlockService = descriptorThis[serviceSymbol];
|
|
17
17
|
const keys = getKeys(key, descriptorThis, args);
|
|
18
18
|
const useDuration = duration || redlockService.options?.duration || redlock_constants_1.DEFAULT_DURATION;
|
|
19
|
-
await redlockService.options
|
|
19
|
+
await redlockService.options?.decoratorHooks?.preLockKeys?.({ keys, duration: useDuration });
|
|
20
20
|
const startTime = Date.now();
|
|
21
21
|
return await redlockService
|
|
22
22
|
.using(keys, useDuration, settings, async (signal) => {
|
|
23
|
-
await redlockService.options
|
|
23
|
+
await redlockService.options?.decoratorHooks?.lockedKeys?.({
|
|
24
24
|
keys,
|
|
25
25
|
duration: useDuration,
|
|
26
26
|
elapsedTime: Date.now() - startTime,
|
|
@@ -32,7 +32,7 @@ function Redlock(key, duration, settings = {}) {
|
|
|
32
32
|
return result;
|
|
33
33
|
})
|
|
34
34
|
.finally(async () => {
|
|
35
|
-
await redlockService.options
|
|
35
|
+
await redlockService.options?.decoratorHooks?.unlockedKeys?.({
|
|
36
36
|
keys,
|
|
37
37
|
duration: useDuration,
|
|
38
38
|
elapsedTime: Date.now() - startTime,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-redlock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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": {
|