Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
1e3ac5f0
Commit
1e3ac5f0
authored
Mar 30, 2026
by
haruka
Committed by
陈曦
Apr 08, 2026
Browse files
fix: resolve errcheck lint for sync.Map type assertion
Co-Authored-By:
Claude Opus 4.6 (1M context)
<
noreply@anthropic.com
>
parent
ef8a7c0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/service/oauth_refresh_api.go
View file @
1e3ac5f0
...
@@ -54,8 +54,13 @@ func NewOAuthRefreshAPI(accountRepo AccountRepository, tokenCache GeminiTokenCac
...
@@ -54,8 +54,13 @@ func NewOAuthRefreshAPI(accountRepo AccountRepository, tokenCache GeminiTokenCac
// getLocalLock 返回指定 cacheKey 的进程内互斥锁
// getLocalLock 返回指定 cacheKey 的进程内互斥锁
func
(
api
*
OAuthRefreshAPI
)
getLocalLock
(
cacheKey
string
)
*
sync
.
Mutex
{
func
(
api
*
OAuthRefreshAPI
)
getLocalLock
(
cacheKey
string
)
*
sync
.
Mutex
{
val
,
_
:=
api
.
localLocks
.
LoadOrStore
(
cacheKey
,
&
sync
.
Mutex
{})
actual
,
_
:=
api
.
localLocks
.
LoadOrStore
(
cacheKey
,
&
sync
.
Mutex
{})
return
val
.
(
*
sync
.
Mutex
)
mu
,
ok
:=
actual
.
(
*
sync
.
Mutex
)
if
!
ok
{
mu
=
&
sync
.
Mutex
{}
api
.
localLocks
.
Store
(
cacheKey
,
mu
)
}
return
mu
}
}
// RefreshIfNeeded 在分布式锁保护下按需刷新 OAuth token
// RefreshIfNeeded 在分布式锁保护下按需刷新 OAuth token
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment