Skip to content

Commit f32b92f

Browse files
committed
fix: remove broken constance cache backend setting for non-Redis environments
The previous commit set CONSTANCE_DATABASE_CACHE_BACKEND = "default" when no Redis is available, but constance rejects Django's default LocMemCache because it requires cross-process caching. This silently disabled all carrier plugins, causing connection creation and validation to fail.
1 parent e9fbb23 commit f32b92f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/api/karrio/server/settings/cache.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
"Skipping default Redis cache configuration (worker mode - only HUEY Redis needed)"
115115
)
116116
else:
117-
# No Redis available — cache constance values using Django's default
118-
# LocMemCache to avoid N+1 database queries on each config access
119-
CONSTANCE_DATABASE_CACHE_BACKEND = "default"
117+
# No Redis available — constance will read directly from the database.
118+
# We intentionally do NOT set CONSTANCE_DATABASE_CACHE_BACKEND here
119+
# because constance rejects Django's default LocMemCache backend
120+
# (it requires a cross-process cache like Redis or Memcached).
121+
pass

modules/core/karrio/server/providers/tests/test_connections.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ def test_create_connection(self):
379379
response = self.client.post(url, SENDLE_CONNECTION_DATA, format="json")
380380
response_data = json.loads(response.content)
381381

382+
print(response)
382383
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
383384
self.assertDictEqual(response_data, SENDLE_CONNECTION_RESPONSE)
384385

0 commit comments

Comments
 (0)