From 6a13ec3299d3f39fed427ebc3f7130462a0af9ac Mon Sep 17 00:00:00 2001 From: aradng Date: Sun, 7 Jun 2026 04:45:35 +0330 Subject: [PATCH] fix: wire HostTenantMapping.Meta.database in _setup_redis HostTenantMapping defines its own Meta (model_key_prefix override), so it never chains to BaseCache.Meta.database and its db() resolves to aredis_om's import-time default (localhost:6379, unauthenticated). On deployments where redis requires AUTH this crashes the boot-time Migrator with AuthenticationError as soon as the cache_enabled gate (fixed in #3) lets it run. Co-Authored-By: Claude Opus 4.7 --- fastloom/tenant/settings.py | 7 ++++++- plugins/fastloom-sdk/.claude-plugin/plugin.json | 2 +- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fastloom/tenant/settings.py b/fastloom/tenant/settings.py index f22a031..132cb7c 100644 --- a/fastloom/tenant/settings.py +++ b/fastloom/tenant/settings.py @@ -9,7 +9,11 @@ JWTAuth, OptionalJWTAuth, ) -from fastloom.cache.base import BaseCache, BaseTenantSettingCache +from fastloom.cache.base import ( + BaseCache, + BaseTenantSettingCache, + HostTenantMapping, +) from fastloom.cache.lifehooks import RedisHandler from fastloom.db.signals import BaseDocumentSignal @@ -114,6 +118,7 @@ def _setup_redis(self): redis = handler.redis BaseCache.Meta.database = redis BaseTenantSettingCache.Meta.database = redis + HostTenantMapping.Meta.database = redis self.tenant_schema.cache.Meta.database = redis if isinstance(self.general, MonitoringSettings): diff --git a/plugins/fastloom-sdk/.claude-plugin/plugin.json b/plugins/fastloom-sdk/.claude-plugin/plugin.json index 1672ba4..6201c0a 100644 --- a/plugins/fastloom-sdk/.claude-plugin/plugin.json +++ b/plugins/fastloom-sdk/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "fastloom-sdk", "description": "Skills for services that consume the fastloom library \u2014 scaffold new services, add routes and RabbitMQ subscribers, audit settings.", - "version": "0.4.40", + "version": "0.4.41", "author": { "name": "aradng" }, diff --git a/pyproject.toml b/pyproject.toml index 0ccb290..7c98464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fastloom" -version = "0.4.40" +version = "0.4.41" description = "Core package" authors = [] readme = "README.md"