fix(amp): update explicit API key on config change

This commit is contained in:
hkfires
2025-12-04 19:32:44 +08:00
parent bceecfb2e3
commit 969ff6bb68
2 changed files with 12 additions and 0 deletions

View File

@@ -190,6 +190,7 @@ func (m *AmpModule) OnConfigUpdated(cfg *config.Config) error {
// If API key changed, invalidate the cache
if m.secretSource != nil {
if ms, ok := m.secretSource.(*MultiSourceSecret); ok {
ms.UpdateExplicitKey(settings.UpstreamAPIKey)
ms.InvalidateCache()
log.Debug("amp secret cache invalidated due to config update")
}