@anchan828/nest-redlock 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +11 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ![npm](https://img.shields.io/npm/v/@anchan828/nest-redlock.svg)
4
4
  ![NPM](https://img.shields.io/npm/l/@anchan828/nest-redlock.svg)
5
5
 
6
- This is a [Nest](https://github.com/nestjs/nest) implementation of the redlock algorithm for distributed redis.
6
+ This is a [Nest](https://github.com/nestjs/nest) implementation of the redlock algorithm for distributed redis locks.
7
7
 
8
8
  This package uses [node-redlock](https://github.com/mike-marcacci/node-redlock).
9
9
 
@@ -24,7 +24,17 @@ import Redis from "ioredis";
24
24
  @Module({
25
25
  imports: [
26
26
  RedisRedlockModule.register({
27
+ // See https://github.com/mike-marcacci/node-redlock#configuration
27
28
  clients: [new Redis({ host: "localhost" })],
29
+ settings: {
30
+ driftFactor: 0.01,
31
+ retryCount: 10,
32
+ retryDelay: 200,
33
+ retryJitter: 200,
34
+ automaticExtensionThreshold: 500,
35
+ },
36
+ // Default duratiuon to use with RedisRedlock decorator
37
+ duration: 1000,
28
38
  }),
29
39
  ],
30
40
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchan828/nest-redlock",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
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": {
@@ -17,7 +17,7 @@
17
17
  "scripts": {
18
18
  "build": "tsc -p tsconfig.build.json",
19
19
  "format": "prettier --write '**/*.{js,json,yml,yaml,md}'",
20
- "postinstall": "husky install",
20
+ "prepare": "husky install",
21
21
  "lint": "TIMING=1 eslint --ignore-path .eslintignore '**/*.ts'",
22
22
  "lint:fix": "npm run lint -- --fix",
23
23
  "test": "jest --coverage --runInBand"