From cc9156a9e3ac7594dbad989478f26ec7157b78d2 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 10 May 2026 18:20:25 +0800 Subject: [PATCH] fix(model): invalidate channel cache after status update UpdateChannelStatusById() updates the database but does not refresh the in-memory channel cache (group2model2channels). When MemoryCacheEnabled is true, the stale cache means disabled channels continue to receive traffic until the next SyncChannelCache cycle (default 600 seconds). Call InitChannelCache() after a successful status update to ensure the cache is immediately consistent with the database. Related: #2309 Co-Authored-By: Claude Opus 4.7 --- model/channel.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model/channel.go b/model/channel.go index 4b0f4b01aa..fefc116ef8 100644 --- a/model/channel.go +++ b/model/channel.go @@ -196,6 +196,9 @@ func UpdateChannelStatusById(id int, status int) { if err != nil { logger.SysError("failed to update channel status: " + err.Error()) } + if config.MemoryCacheEnabled { + InitChannelCache() + } } func UpdateChannelUsedQuota(id int, quota int64) {