L
Locking redis
Redis Lock for Medusa
@medusajs/locking-redis
Documentation | Website
Building blocks for digital commerce
Redis Locking Module Provider for Medusa: implements the Locking Module's locks in Redis, so locks are shared across all Medusa instances. It's the recommended locking provider for production. It ships with and is registered through the path.
At a glance
| Package | |
| Type | Module Provider (Locking Module) |
| Provider ID | |
| Registered by default | No (on Medusa Cloud, registered as the default when is set) |
| Import from |
Installation
No installation needed. The provider is a dependency of . You need a running Redis server.
Usage
Register the provider in the Locking Module's array in :
Configuration
| Option | Type | Description | Default |
|---|---|---|---|
| Required. The Redis connection URL. | - | ||
| Options passed to the client. | - | ||
| Prefix for lock keys. | |||
| Default time to wait to acquire a lock, in seconds. | |||
| Initial interval between lock attempts, in milliseconds. | |||
| Maximum interval between lock attempts, in milliseconds. | |||
| Multiplier applied to the retry interval after each attempt. |
| Environment variable | Description |
|---|---|
| Value for , as used in the example above. | |
| On Medusa Cloud, registers this provider as the default with this URL. |

