fix: cache tenant routing on message hot path

This commit is contained in:
richjohnrambo
2026-09-27 20:10:18 +08:00
parent 36b52e120c
commit 8e778726e0
12 changed files with 196 additions and 44 deletions
+4
View File
@@ -7,6 +7,7 @@ import (
"sync"
"time"
adapter "github.com/tinode/chat/server/db"
"github.com/tinode/chat/server/store/types"
)
@@ -152,6 +153,9 @@ func InvalidateTenantConfigCache(code string, id types.TenantID) {
tenantByIDCache.clear()
realNamePolicyCache.clear()
}
if invalidator, ok := adp.(adapter.TenantRouteCacheInvalidator); ok {
invalidator.InvalidateTenantRoute(id)
}
}
// InvalidateRegistrationConfigCache clears cached global registration config.