murlock 4.4.1 → 5.1.0
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/README.md +49 -3
- package/dist/als/als-manager.d.ts +4 -17
- package/dist/als/als-manager.js +4 -49
- package/dist/als/als-manager.js.map +1 -1
- package/dist/als/als.module.js +1 -3
- package/dist/als/als.module.js.map +1 -1
- package/dist/als/als.service.d.ts +7 -5
- package/dist/als/als.service.js +4 -10
- package/dist/als/als.service.js.map +1 -1
- package/dist/decorators/murlock.decorator.js +6 -5
- package/dist/decorators/murlock.decorator.js.map +1 -1
- package/dist/exceptions/murlock-redis.exception.d.ts +2 -1
- package/dist/exceptions/murlock-redis.exception.js +2 -1
- package/dist/exceptions/murlock-redis.exception.js.map +1 -1
- package/dist/interfaces/murlock-options.interface.d.ts +6 -0
- package/dist/lua/extend.lua +9 -0
- package/dist/murlock.service.d.ts +9 -0
- package/dist/murlock.service.js +212 -36
- package/dist/murlock.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -166,6 +166,8 @@ async anotherFunction(user: User): Promise<void> {
|
|
|
166
166
|
|
|
167
167
|
When using `@MurLock` with other decorators (such as `@Transactional` from typeorm-transactional), you may encounter issues with parameter name extraction if the other decorator wraps the method before `@MurLock` is applied.
|
|
168
168
|
|
|
169
|
+
> **Note on minification / transpilation:** MurLock derives parameter names by parsing the method signature at runtime. Aggressive minifiers/bundlers (terser, esbuild, swc) may rename or strip parameter names, in which case **name-based** key params (e.g. `'userId'`, `'user.id'`) cannot be resolved and the decorator throws `Parameter ... not found`. If you minify your server build, either use **numeric index** key params (e.g. `'0'`, `'0.id'`) — which are always stable — or declare names explicitly with `@SetParamNames` (below).
|
|
170
|
+
|
|
169
171
|
### Problem
|
|
170
172
|
|
|
171
173
|
TypeScript decorators execute in bottom-up order. If another decorator wraps the method before `@MurLock`, the parameter names cannot be extracted from the wrapped function:
|
|
@@ -295,13 +297,45 @@ When blocking mode is enabled:
|
|
|
295
297
|
- Each retry will wait for the specified `wait` time
|
|
296
298
|
- Redis errors will be logged but won't stop the retry process
|
|
297
299
|
|
|
300
|
+
## Auto-Extend (Watchdog)
|
|
301
|
+
|
|
302
|
+
A lock is created with a fixed TTL (`releaseTime`). If your operation runs **longer** than `releaseTime`, the lock would normally expire while the work is still in progress — at which point another instance could acquire the same lock and break mutual exclusion (and the original holder would then fail to release it).
|
|
303
|
+
|
|
304
|
+
Enable `autoExtend` to start a watchdog that periodically extends the lock's TTL (only while *this* instance still owns it) for as long as the wrapped operation runs:
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
@Module({
|
|
308
|
+
imports: [
|
|
309
|
+
MurLockModule.forRoot({
|
|
310
|
+
redisOptions: { url: 'redis://localhost:6379' },
|
|
311
|
+
wait: 1000,
|
|
312
|
+
maxAttempts: 3,
|
|
313
|
+
logLevel: 'log',
|
|
314
|
+
autoExtend: true, // keep the lock alive while the operation runs
|
|
315
|
+
extendInterval: 1000, // optional; defaults to releaseTime / 3
|
|
316
|
+
}),
|
|
317
|
+
],
|
|
318
|
+
})
|
|
319
|
+
export class AppModule {}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Behavior:
|
|
323
|
+
|
|
324
|
+
- The TTL is refreshed every `extendInterval` ms (default: `Math.floor(releaseTime / 3)`).
|
|
325
|
+
- Extension is ownership-checked: if the lock is lost (e.g. it expired before the first refresh, or was taken over), the watchdog stops and logs a warning.
|
|
326
|
+
- The watchdog timer is `unref`'d, so it never keeps your process alive on its own.
|
|
327
|
+
- Defaults to `false`, so existing behavior is unchanged.
|
|
328
|
+
|
|
329
|
+
> **Tip:** This is especially valuable together with `blocking: true`. Blocking mode makes callers queue until the lock frees, but if the current holder runs longer than `releaseTime` the lock still expires underneath it. `autoExtend` keeps the holder's lock valid for the full duration of its work, so "wait for the previous execution to finish" actually holds even for long-running operations.
|
|
330
|
+
|
|
298
331
|
## Redis Connection Handling
|
|
299
332
|
|
|
300
333
|
MurLock includes robust Redis connection handling:
|
|
301
334
|
|
|
302
335
|
- **Automatic Reconnection**: Implements a reconnection strategy with exponential backoff
|
|
303
336
|
- **Connection Events**: Logs connection status changes (ready, reconnecting, end)
|
|
304
|
-
- **Fail-Fast Option**: Can be configured to
|
|
337
|
+
- **Fail-Fast Option**: Can be configured to throw during startup if the **initial** Redis connection fails
|
|
338
|
+
- **Custom Error Handling**: Provide an `onRedisError` callback to react to runtime Redis errors (alerting, custom fail-fast, etc.)
|
|
305
339
|
|
|
306
340
|
```typescript
|
|
307
341
|
@Module({
|
|
@@ -317,13 +351,19 @@ MurLock includes robust Redis connection handling:
|
|
|
317
351
|
},
|
|
318
352
|
},
|
|
319
353
|
},
|
|
320
|
-
failFastOnRedisError: true, //
|
|
354
|
+
failFastOnRedisError: true, // Throw on startup if the initial connection fails
|
|
355
|
+
onRedisError: (err) => {
|
|
356
|
+
// Optional: custom handling for runtime Redis errors
|
|
357
|
+
console.error('Redis error:', err.message);
|
|
358
|
+
},
|
|
321
359
|
}),
|
|
322
360
|
],
|
|
323
361
|
})
|
|
324
362
|
export class AppModule {}
|
|
325
363
|
```
|
|
326
364
|
|
|
365
|
+
> **Note (v5 behavior change):** Runtime Redis `error` events no longer terminate the process. Previously, with `failFastOnRedisError: true`, *any* runtime Redis error (including transient network blips) would call `process.exit(1)`, taking the whole application down mid-request. Now `failFastOnRedisError` applies only to the initial connection attempt; runtime errors are logged, recovery is handled by the reconnect strategy, and you can opt into custom handling via `onRedisError`.
|
|
366
|
+
|
|
327
367
|
## Using Custom Lock Key
|
|
328
368
|
|
|
329
369
|
By default, murlock use class and method name prefix for example Userservice:createUser:{userId}. By setting lockKeyPrefix as 'custom' you can define by yourself manually.
|
|
@@ -476,8 +516,14 @@ Here are the customizable options for `MurLockModule`, allowing you to tailor it
|
|
|
476
516
|
- **lockKeyPrefix (optional)**: Specifies how lock keys are prefixed, allowing for greater flexibility:
|
|
477
517
|
- **Default**: Uses class and method names as prefixes, e.g., `Userservice:createUser:{userId}`.
|
|
478
518
|
- **Custom**: Set this to 'custom' to define lock keys manually in your service methods, allowing for specific lock key constructions beyond the standard naming.
|
|
479
|
-
- **failFastOnRedisError (optional)**: When set to `true`, the application will
|
|
519
|
+
- **failFastOnRedisError (optional)**: When set to `true`, the application will throw during startup (`onModuleInit`) if the **initial** Redis connection fails. Defaults to `false`. **Note (behavior change):** this option no longer terminates the process on *runtime* Redis errors (e.g. transient network blips). Runtime errors are logged and recovery is handled by the reconnect strategy. Use `onRedisError` for custom runtime handling.
|
|
480
520
|
- **blocking (optional)**: When set to `true`, the lock acquisition will retry indefinitely until successful. Defaults to `false`.
|
|
521
|
+
- **autoExtend (optional)**: When set to `true`, MurLock keeps the lock alive while the wrapped operation is still running by periodically extending its TTL (a "watchdog"). This prevents the lock from expiring mid-execution when an operation runs longer than `releaseTime`, which would otherwise let another instance acquire the same lock and break mutual exclusion. Defaults to `false`.
|
|
522
|
+
- **extendInterval (optional)**: Interval in milliseconds between watchdog TTL extensions. Only used when `autoExtend` is `true`. Defaults to one third of the lock's `releaseTime` (`Math.floor(releaseTime / 3)`), guaranteeing at least two refresh attempts before the TTL would expire.
|
|
523
|
+
- **onRedisError (optional)**: Callback `(error: Error) => void` invoked when the Redis client emits a runtime `error` event. Use it to plug in custom alerting or fail-fast behavior.
|
|
524
|
+
- **reentrant (optional)**: When set to `true`, locks become reentrant within the same async context: a method that locks a key and (directly or transitively) calls another method locking the **same** key reuses the existing lock instead of deadlocking. The underlying Redis lock is acquired once (outermost entry) and released when the outermost call completes. Defaults to `false`.
|
|
525
|
+
- **encodeKeyParts (optional)**: When set to `true`, each lock-key part derived from method arguments is URL-encoded so values containing the `:` separator cannot collide (e.g. `a:b` + `c` vs `a` + `b:c`). Changes the generated key format, so it is opt-in to avoid breaking existing keys across a rolling deploy. Defaults to `false`.
|
|
526
|
+
- **jitter (optional)**: When set to `true`, retry back-off delays use equal jitter (`delay/2 + random*delay/2`) to avoid a thundering herd when many workers wait on the same lock. Applies to both attempt-based and blocking modes. Defaults to `false`.
|
|
481
527
|
|
|
482
528
|
### MurLockService
|
|
483
529
|
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
-
export declare class AsyncStorageManager<T>
|
|
3
|
+
export declare class AsyncStorageManager<T> {
|
|
4
4
|
private readonly asyncLocalStorage;
|
|
5
|
-
constructor(asyncLocalStorage?: AsyncLocalStorage<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
runWithNewContext<R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs): R;
|
|
9
|
-
set(key: string, value: T): this;
|
|
10
|
-
get(key: string): T | undefined;
|
|
11
|
-
clear(): void;
|
|
12
|
-
delete(key: string): boolean;
|
|
13
|
-
forEach(callbackfn: (value: T, key: string, map: Map<string, T>) => void, thisArg?: any): void;
|
|
14
|
-
has(key: string): boolean;
|
|
15
|
-
get size(): number;
|
|
16
|
-
entries(): IterableIterator<[string, T]>;
|
|
17
|
-
keys(): IterableIterator<string>;
|
|
18
|
-
values(): IterableIterator<T>;
|
|
19
|
-
[Symbol.iterator](): IterableIterator<[string, T]>;
|
|
20
|
-
[Symbol.toStringTag]: string;
|
|
5
|
+
constructor(asyncLocalStorage?: AsyncLocalStorage<T>);
|
|
6
|
+
run<R>(store: T, fn: () => R): R;
|
|
7
|
+
getStore(): T | undefined;
|
|
21
8
|
}
|
package/dist/als/als-manager.js
CHANGED
|
@@ -8,67 +8,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var _a;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.AsyncStorageManager = void 0;
|
|
14
13
|
const common_1 = require("@nestjs/common");
|
|
15
14
|
const async_hooks_1 = require("async_hooks");
|
|
16
|
-
const exceptions_1 = require("../exceptions");
|
|
17
15
|
let AsyncStorageManager = class AsyncStorageManager {
|
|
18
16
|
constructor(asyncLocalStorage = new async_hooks_1.AsyncLocalStorage()) {
|
|
19
17
|
this.asyncLocalStorage = asyncLocalStorage;
|
|
20
|
-
this[_a] = '[object AsyncContext]';
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!store) {
|
|
25
|
-
throw new exceptions_1.AsyncStorageManagerException('No active store found');
|
|
26
|
-
}
|
|
27
|
-
return store;
|
|
28
|
-
}
|
|
29
|
-
register() {
|
|
30
|
-
this.asyncLocalStorage.enterWith(new Map());
|
|
31
|
-
}
|
|
32
|
-
runWithNewContext(fn, ...args) {
|
|
33
|
-
return this.asyncLocalStorage.run(new Map(), fn, ...args);
|
|
34
|
-
}
|
|
35
|
-
set(key, value) {
|
|
36
|
-
this.getStore().set(key, value);
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
get(key) {
|
|
40
|
-
return this.getStore().get(key);
|
|
41
|
-
}
|
|
42
|
-
clear() {
|
|
43
|
-
return this.getStore().clear();
|
|
44
|
-
}
|
|
45
|
-
delete(key) {
|
|
46
|
-
return this.getStore().delete(key);
|
|
19
|
+
run(store, fn) {
|
|
20
|
+
return this.asyncLocalStorage.run(store, fn);
|
|
47
21
|
}
|
|
48
|
-
|
|
49
|
-
return this.getStore()
|
|
50
|
-
}
|
|
51
|
-
has(key) {
|
|
52
|
-
return this.getStore().has(key);
|
|
53
|
-
}
|
|
54
|
-
get size() {
|
|
55
|
-
return this.getStore().size;
|
|
56
|
-
}
|
|
57
|
-
entries() {
|
|
58
|
-
return this.getStore().entries();
|
|
59
|
-
}
|
|
60
|
-
keys() {
|
|
61
|
-
return this.getStore().keys();
|
|
62
|
-
}
|
|
63
|
-
values() {
|
|
64
|
-
return this.getStore().values();
|
|
65
|
-
}
|
|
66
|
-
[Symbol.iterator]() {
|
|
67
|
-
return this.getStore()[Symbol.iterator]();
|
|
22
|
+
getStore() {
|
|
23
|
+
return this.asyncLocalStorage.getStore();
|
|
68
24
|
}
|
|
69
25
|
};
|
|
70
26
|
exports.AsyncStorageManager = AsyncStorageManager;
|
|
71
|
-
_a = Symbol.toStringTag;
|
|
72
27
|
exports.AsyncStorageManager = AsyncStorageManager = __decorate([
|
|
73
28
|
(0, common_1.Injectable)(),
|
|
74
29
|
__metadata("design:paramtypes", [Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"als-manager.js","sourceRoot":"","sources":["../../lib/als/als-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"als-manager.js","sourceRoot":"","sources":["../../lib/als/als-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAgD;AAQzC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,oBAAoB,IAAI,+BAAiB,EAAK;QAA9C,sBAAiB,GAAjB,iBAAiB,CAA6B;IAC9D,CAAC;IAGJ,GAAG,CAAI,KAAQ,EAAE,EAAW;QAC1B,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAGD,QAAQ;QACN,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF,CAAA;AAdY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;;GACA,mBAAmB,CAc/B"}
|
package/dist/als/als.module.js
CHANGED
|
@@ -20,9 +20,7 @@ exports.AsyncStorageManagerModule = AsyncStorageManagerModule = __decorate([
|
|
|
20
20
|
providers: [
|
|
21
21
|
{
|
|
22
22
|
provide: als_manager_1.AsyncStorageManager,
|
|
23
|
-
useFactory: () =>
|
|
24
|
-
return new als_manager_1.AsyncStorageManager(new async_hooks_1.AsyncLocalStorage());
|
|
25
|
-
},
|
|
23
|
+
useFactory: () => new als_manager_1.AsyncStorageManager(new async_hooks_1.AsyncLocalStorage()),
|
|
26
24
|
},
|
|
27
25
|
als_service_1.AsyncStorageService,
|
|
28
26
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"als.module.js","sourceRoot":"","sources":["../../lib/als/als.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,+CAAoD;AACpD,+
|
|
1
|
+
{"version":3,"file":"als.module.js","sourceRoot":"","sources":["../../lib/als/als.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,+CAAoD;AACpD,+CAAoE;AACpE,6CAAgD;AAgBzC,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAAG,CAAA;AAA5B,8DAAyB;oCAAzB,yBAAyB;IAdrC,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,iCAAmB;gBAC5B,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,iCAAmB,CACrB,IAAI,+BAAiB,EAAkB,CACxC;aACJ;YACD,iCAAmB;SACpB;QACD,OAAO,EAAE,CAAC,iCAAmB,CAAC;KAC/B,CAAC;GACW,yBAAyB,CAAG"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AsyncStorageManager } from './als-manager';
|
|
2
|
+
export interface MurLockContext {
|
|
3
|
+
clientId: string;
|
|
4
|
+
holds: Map<string, number>;
|
|
5
|
+
}
|
|
2
6
|
export declare class AsyncStorageService {
|
|
3
7
|
private readonly asyncStorageManager;
|
|
4
|
-
constructor(asyncStorageManager: AsyncStorageManager<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get(key: string): string;
|
|
8
|
-
setClientID(key: string, value: string): void;
|
|
8
|
+
constructor(asyncStorageManager: AsyncStorageManager<MurLockContext>);
|
|
9
|
+
run<R>(store: MurLockContext, fn: () => R): R;
|
|
10
|
+
getContext(): MurLockContext | undefined;
|
|
9
11
|
}
|
package/dist/als/als.service.js
CHANGED
|
@@ -16,17 +16,11 @@ let AsyncStorageService = class AsyncStorageService {
|
|
|
16
16
|
constructor(asyncStorageManager) {
|
|
17
17
|
this.asyncStorageManager = asyncStorageManager;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
return this.asyncStorageManager.
|
|
19
|
+
run(store, fn) {
|
|
20
|
+
return this.asyncStorageManager.run(store, fn);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
this.asyncStorageManager.
|
|
24
|
-
}
|
|
25
|
-
get(key) {
|
|
26
|
-
return this.asyncStorageManager.get(key);
|
|
27
|
-
}
|
|
28
|
-
setClientID(key, value) {
|
|
29
|
-
this.asyncStorageManager.set(key, value);
|
|
22
|
+
getContext() {
|
|
23
|
+
return this.asyncStorageManager.getStore();
|
|
30
24
|
}
|
|
31
25
|
};
|
|
32
26
|
exports.AsyncStorageService = AsyncStorageService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"als.service.js","sourceRoot":"","sources":["../../lib/als/als.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;
|
|
1
|
+
{"version":3,"file":"als.service.js","sourceRoot":"","sources":["../../lib/als/als.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AAa7C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,mBAAwD;QAAxD,wBAAmB,GAAnB,mBAAmB,CAAqC;IACxE,CAAC;IAGJ,GAAG,CAAI,KAAqB,EAAE,EAAW;QACvC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAGD,UAAU;QACR,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;CACF,CAAA;AAdY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAG6B,iCAAmB;GAFhD,mBAAmB,CAc/B"}
|
|
@@ -121,7 +121,8 @@ function MurLock(releaseTime, waitOrKeyParam, ...keyParams) {
|
|
|
121
121
|
}
|
|
122
122
|
return methodParameterNames.indexOf(source);
|
|
123
123
|
}
|
|
124
|
-
function constructLockKey(args, lockKeyPrefix = 'default') {
|
|
124
|
+
function constructLockKey(args, lockKeyPrefix = 'default', encodeKeyParts = false) {
|
|
125
|
+
const encodePart = (value) => encodeKeyParts ? encodeURIComponent(String(value)) : value;
|
|
125
126
|
const lockKeyElements = [];
|
|
126
127
|
if (lockKeyPrefix != 'custom') {
|
|
127
128
|
lockKeyElements.push(target.constructor.name);
|
|
@@ -145,11 +146,11 @@ function MurLock(releaseTime, waitOrKeyParam, ...keyParams) {
|
|
|
145
146
|
typeof parameterValue === 'object' &&
|
|
146
147
|
parameterValue !== null &&
|
|
147
148
|
path in parameterValue) {
|
|
148
|
-
return parameterValue[path];
|
|
149
|
+
return encodePart(parameterValue[path]);
|
|
149
150
|
}
|
|
150
|
-
return parameterValue instanceof Object
|
|
151
|
+
return encodePart(parameterValue instanceof Object
|
|
151
152
|
? parameterValue.toString()
|
|
152
|
-
: parameterValue;
|
|
153
|
+
: parameterValue);
|
|
153
154
|
}
|
|
154
155
|
if (lockKeyPrefix == 'custom') {
|
|
155
156
|
return source;
|
|
@@ -161,7 +162,7 @@ function MurLock(releaseTime, waitOrKeyParam, ...keyParams) {
|
|
|
161
162
|
const wrapped = function (...args) {
|
|
162
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
164
|
const murLockService = this.murlockServiceDecorator;
|
|
164
|
-
const lockKey = constructLockKey(args, murLockService.options.lockKeyPrefix);
|
|
165
|
+
const lockKey = constructLockKey(args, murLockService.options.lockKeyPrefix, murLockService.options.encodeKeyParts);
|
|
165
166
|
if (!murLockService) {
|
|
166
167
|
throw new exceptions_1.MurLockException('MurLockService is not available.');
|
|
167
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"murlock.decorator.js","sourceRoot":"","sources":["../../lib/decorators/murlock.decorator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,4BAA0B;AAC1B,8CAAiD;AACjD,wDAAoD;AAMvC,QAAA,eAAe,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAMhD,QAAA,mBAAmB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AA8CrE,SAAgB,aAAa,CAC3B,mBAA2C,EAC3C,GAAG,cAAwB;IAE3B,OAAO,UACL,MAAW,EACX,WAAmB,EACnB,UAA8B;QAE9B,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;YAE3C,OAAO,CAAC,cAAc,CACpB,2BAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,WAAW,CACZ,CAAC;SACH;aAAM;YAEL,MAAM,UAAU,GAAG,CAAC,mBAAmB,EAAE,GAAG,cAAc,CAAC,CAAC;YAC5D,OAAO,CAAC,cAAc,CAAC,uBAAe,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SAC1E;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAxBD,sCAwBC;AAOD,SAAS,iBAAiB,CAAC,IAAc;IACvC,MAAM,cAAc,GAAG,kCAAkC,CAAC;IAE1D,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1E,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;QACrB,OAAO,EAAE,CAAC;KACX;IAGD,MAAM,MAAM,G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AAC5E,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE;IAChE,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;KAC3B;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;QAClD,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;KACxB;IACD,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MurLockRedisException = void 0;
|
|
4
|
-
|
|
4
|
+
const murlock_exception_1 = require("./murlock.exception");
|
|
5
|
+
class MurLockRedisException extends murlock_exception_1.MurLockException {
|
|
5
6
|
constructor(message) {
|
|
6
7
|
super(message);
|
|
7
8
|
this.name = "MurLockRedisException";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"murlock-redis.exception.js","sourceRoot":"","sources":["../../lib/exceptions/murlock-redis.exception.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAsB,SAAQ,
|
|
1
|
+
{"version":3,"file":"murlock-redis.exception.js","sourceRoot":"","sources":["../../lib/exceptions/murlock-redis.exception.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAQvD,MAAa,qBAAsB,SAAQ,oCAAgB;IACzD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC"}
|
|
@@ -8,6 +8,12 @@ export interface MurLockModuleOptions {
|
|
|
8
8
|
lockKeyPrefix?: 'default' | 'custom';
|
|
9
9
|
failFastOnRedisError?: boolean;
|
|
10
10
|
blocking?: boolean;
|
|
11
|
+
autoExtend?: boolean;
|
|
12
|
+
extendInterval?: number;
|
|
13
|
+
onRedisError?: (error: Error) => void;
|
|
14
|
+
reentrant?: boolean;
|
|
15
|
+
encodeKeyParts?: boolean;
|
|
16
|
+
jitter?: boolean;
|
|
11
17
|
}
|
|
12
18
|
export interface MurLockModuleAsyncOptions {
|
|
13
19
|
imports?: any[];
|
|
@@ -8,17 +8,26 @@ export declare class MurLockService implements OnModuleInit, OnApplicationShutdo
|
|
|
8
8
|
private redisClient;
|
|
9
9
|
private lockScript;
|
|
10
10
|
private unlockScript;
|
|
11
|
+
private extendScript;
|
|
12
|
+
private readonly scriptShas;
|
|
11
13
|
constructor(options: MurLockModuleOptions, asyncStorageService: AsyncStorageService);
|
|
12
14
|
onModuleInit(): Promise<void>;
|
|
13
15
|
onApplicationShutdown(signal?: string): Promise<void>;
|
|
16
|
+
private validateOptions;
|
|
14
17
|
private sleep;
|
|
18
|
+
private withJitter;
|
|
15
19
|
private log;
|
|
20
|
+
private loadScripts;
|
|
21
|
+
private evalScript;
|
|
16
22
|
private lock;
|
|
17
23
|
private unlock;
|
|
24
|
+
private extendLock;
|
|
25
|
+
private startWatchdog;
|
|
18
26
|
private acquireLock;
|
|
19
27
|
private releaseLock;
|
|
20
28
|
runWithLock<R>(lockKey: string, releaseTime: number, fn: () => Promise<R>): Promise<R>;
|
|
21
29
|
runWithLock<R>(lockKey: string, releaseTime: number, wait: number | ((retries: number) => number), fn: () => Promise<R>): Promise<R>;
|
|
30
|
+
private runReentrant;
|
|
22
31
|
private registerRedisErrorHandlers;
|
|
23
32
|
private blockingLock;
|
|
24
33
|
}
|