A distributed locking solution for NestJS, providing a decorator for critical sections with Redis-based synchronization. Version 5.1.0 is current. It offers parameter-based locking, retry with exponential backoff, blocking mode, and fail-fast options. Compared to alternatives like nestjs-redis-lock, MurLock emphasizes NestJS decorator integration and configurability. Released as a peer-dependency package requiring @nestjs/common >=10.0.5.
npm install murlockNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows module import with forRoot configuration and decorator usage on a service method.
Update decorator calls: @MurLock(5000, 'key') instead of @MurLock('key', 5000).Replace `MurLockModule.forRootAsync({ ... })` with `MurLockModule.forRoot({ ... })`.Set `failFastOnRedisError: false` to gracefully handle Redis connection issues.
Wrap primitive parameters in an object before passing, or use a different key syntax.
Remove custom Redis client; use `redisOptions: { url: '...' }` instead.Run `npm install murlock redis reflect-metadata` and ensure import is from 'murlock'.
Increase `wait` and/or `maxAttempts` in MurLockModule config, or reduce lock hold time.
Ensure the parameter is an object with the specified property; check parameter index for multi-arg methods.
Start Redis server or update `redisOptions.url` with correct connection string.