mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-15 23:22:59 +08:00
The channel cache holds a groupID -> platform map with a 10 minute TTL, and only channel Create/Update/Delete call invalidateCache(). Changing a group's platform through the admin API therefore leaves the cache pointing at the old platform for up to 10 minutes. Channel pricing, model mapping and the model whitelist are all matched per platform, so during that window the lookups silently miss: pricing falls back to the global LiteLLM price list, renames stop applying and the whitelist stops restricting. Nothing is logged. Inject a narrow ChannelCacheInvalidator into the admin service (same shape as the existing APIKeyAuthCacheInvalidator) and call it from UpdateGroup only when the platform actually changed. The dependency is optional -- when it is nil the cache simply rebuilds on TTL expiry, as before.