fix(utils): Enable Redis locking by default in Cloud (#12017)

* fix(utils): Enable redis locking by default

* fix: tests

* Create popular-rules-shake.md
This commit is contained in:
Oli Juhl
2025-03-28 16:23:02 +01:00
committed by GitHub
parent 9c90a39f1c
commit 79cfc1a69e
3 changed files with 29 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---
fix(utils): Enable Redis locking by default in Cloud

View File

@@ -1051,9 +1051,18 @@ describe("defineConfig", function () {
},
"locking": {
"options": {
"redisUrl": "redis://localhost:6379",
"providers": [
{
"id": "locking-redis",
"is_default": true,
"options": {
"redisUrl": "redis://localhost:6379",
},
"resolve": "@medusajs/medusa/locking-redis",
},
],
},
"resolve": "@medusajs/medusa/locking-redis",
"resolve": "@medusajs/medusa/locking",
},
"notification": {
"options": {

View File

@@ -233,10 +233,20 @@ function resolveModules(
options: { redisUrl: process.env.REDIS_URL },
},
{
resolve: TEMPORARY_REDIS_MODULE_PACKAGE_NAMES[Modules.LOCKING],
options: { redisUrl: process.env.REDIS_URL },
resolve: MODULE_PACKAGE_NAMES[Modules.LOCKING],
options: {
providers: [
{
id: "locking-redis",
resolve: TEMPORARY_REDIS_MODULE_PACKAGE_NAMES[Modules.LOCKING],
is_default: true,
options: {
redisUrl: process.env.REDIS_URL,
},
},
],
},
},
{
resolve: MODULE_PACKAGE_NAMES[Modules.FILE],
options: {