You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -170,14 +171,16 @@ First argument is the lock key. Second argument is optional and is the lock expi
170
171
Restore a lock. Useful when sharing a lock between multiple processes. See [Sharing a lock between multiple processes](./usage.md#sharing-a-lock-between-multiple-processes) for more details.
Note that the Redis store does **not** use the redlock algorithm. It uses a simple `setnx` as described in the [Redis documentation](https://redis.io/commands/set/). We may introduce a redlock strategy in the future.
62
63
63
64
## Memory
64
65
65
-
The memory store is a simple in-memory store, so don't use it in a multi-server environment.
66
+
The memory store is a simple in-memory store, so don't use it in a multi-server environment.
66
67
67
68
Use [async-mutex](https://www.npmjs.com/package/async-mutex) under the hood.
// Name of the table where the locks will be stored
132
133
table: {
133
-
name: 'locks'
134
+
name: 'locks',
134
135
},
135
136
})
136
137
137
138
const lockFactory =newLockFactory(store)
138
-
139
139
```
140
+
140
141
:::
141
142
142
143
The DynamoDB table will be automatically created if it does not exists. Otherwise, you can create it manually and specify the name of the table in the options.
const db =knex({ client: 'mysql2', connection: MYSQL_CREDENTIALS })
197
-
const store =knexStore({ dialect: 'sqlite', connection: db })
199
+
const store =newDatabaseStore(newKnexAdapter(db))
198
200
const lockFactory =newLockFactory(store)
199
201
```
200
202
@@ -204,7 +206,6 @@ const lockFactory = new LockFactory(store)
204
206
205
207
You must provide a Kysely instance to use the Kysely driver. Feel free to check the [Kysely documentation](https://kysely.dev/) for more details about the configuration. Kysely support the following databases : SQLite, MySQL, PostgreSQL and MSSQL.
206
208
207
-
208
209
:::codegroup
209
210
210
211
```ts
@@ -218,19 +219,20 @@ const db = new Kysely<Database>({ dialect })
218
219
const verrou =newVerrou({
219
220
default: 'kysely',
220
221
stores: {
221
-
kysely: { driver: kyselyStore({ connection: db }) }
222
-
}
222
+
kysely: { driver: kyselyStore({ connection: db }) },
0 commit comments