"frontend/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "7d4b7deea921e19ce779881f40243d90a8aef7a9"
Commit 49e99e9d authored by haruka's avatar haruka
Browse files

fix: resolve errcheck lint for sync.Map type assertion


Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
parent ad2cd976
......@@ -54,8 +54,13 @@ func NewOAuthRefreshAPI(accountRepo AccountRepository, tokenCache GeminiTokenCac
// getLocalLock 返回指定 cacheKey 的进程内互斥锁
func (api *OAuthRefreshAPI) getLocalLock(cacheKey string) *sync.Mutex {
val, _ := api.localLocks.LoadOrStore(cacheKey, &sync.Mutex{})
return val.(*sync.Mutex)
actual, _ := api.localLocks.LoadOrStore(cacheKey, &sync.Mutex{})
mu, ok := actual.(*sync.Mutex)
if !ok {
mu = &sync.Mutex{}
api.localLocks.Store(cacheKey, mu)
}
return mu
}
// RefreshIfNeeded 在分布式锁保护下按需刷新 OAuth token
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment