mirror of
https://github.com/katanemo/plano.git
synced 2026-05-30 14:25:15 +02:00
add tenant-scoped Redis session cache keys and remove dead log_affinity_hit
- Add tenant_header to SessionCacheConfig; when set, cache keys are scoped
as plano:affinity:{tenant_id}:{session_id} for multi-tenant isolation
- Thread tenant_id through RouterService, routing_service, and llm handlers
- Use Cow<'_, str> in session_key to avoid allocation when no tenant is set
- Remove unused log_affinity_hit (logging was already inlined at call sites)
This commit is contained in:
parent
a5ac015fde
commit
03cb09f47e
7 changed files with 92 additions and 35 deletions
|
|
@ -21,6 +21,9 @@ pub struct SessionCacheConfig {
|
|||
pub cache_type: SessionCacheType,
|
||||
/// Redis URL, e.g. `redis://localhost:6379`. Required when `type` is `redis`.
|
||||
pub url: Option<String>,
|
||||
/// Optional HTTP header name whose value is used as a tenant prefix in the cache key.
|
||||
/// When set, keys are scoped as `plano:affinity:{tenant_id}:{session_id}`.
|
||||
pub tenant_header: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue