mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-10-31 04:02:03 +01:00
feat(api): make Redis a required cache dependency
Redis becomes mandatory infrastructure (PostgreSQL-parity): the REDIS_ENABLED flag, NullCache backend, and every conditional caching code path are removed. /health/ready reports not_ready (503) when Redis is unreachable and cached endpoints return 503 instead of silently degrading; invalidation helpers never raise after a committed write. The bundled redis container joins the core profile only via docker-compose.dev.yml (production points REDIS_* at an external instance, same no-shadowing pattern as postgres), the backend suite runs against real Redis (test-redis on 127.0.0.1:55433, CI redis:8 service container, per-xdist-worker key prefixes), and operator docs describe the required-dependency setup (upgrading.md gains the v0.20.0 section).
This commit is contained in:
26 files changed
+957
-449
No files matched your search
@@ -1,5 +1,5 @@
|
||||
# ==========================================================================
|
||||
# Throwaway PostgreSQL instance for the backend test suite (pytest).
|
||||
# Throwaway PostgreSQL + Redis instances for the backend test suite (pytest).
|
||||
#
|
||||
# NOT part of the application stack. Start/stop with:
|
||||
# make test-db-up
|
||||
@@ -11,7 +11,8 @@
|
||||
# The meshcorehub role owns the meshcorehub_test database (image entrypoint),
|
||||
# which is exactly the privilege the per-xdist-worker test schemas need
|
||||
# (CREATE SCHEMA) — no superuser and no CREATEDB required. The data directory
|
||||
# is a tmpfs mount, so nothing survives `down`.
|
||||
# is a tmpfs mount, so nothing survives `down`. Redis (required cache
|
||||
# infrastructure) is published on 55433 with the same tmpfs treatment.
|
||||
# ==========================================================================
|
||||
name: meshcore-hub-test-db
|
||||
|
||||
@@ -36,3 +37,16 @@ services:
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
test-redis:
|
||||
image: redis:8-alpine
|
||||
container_name: meshcore-hub-test-redis
|
||||
ports:
|
||||
- "127.0.0.1:55433:6379"
|
||||
tmpfs:
|
||||
- /data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
Reference in new issue
Block a user