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
1727b8df
Unverified
Commit
1727b8df
authored
Mar 31, 2026
by
Wesley Liddick
Committed by
GitHub
Mar 31, 2026
Browse files
Merge pull request #1404 from DaydreamCoding/feat/antigravity-privacy-on-refresh-fail
feat(antigravity): 令牌刷新失败及创建账号时也设置隐私
parents
a025a15f
46bc5ca7
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/internal/service/admin_service.go
View file @
1727b8df
...
...
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"log/slog"
"net/http"
"strings"
"time"
...
...
@@ -1587,6 +1588,18 @@ func (s *adminServiceImpl) CreateAccount(ctx context.Context, input *CreateAccou
}
}
// Antigravity OAuth 账号:创建后异步设置隐私
if
account
.
Platform
==
PlatformAntigravity
&&
account
.
Type
==
AccountTypeOAuth
{
go
func
()
{
defer
func
()
{
if
r
:=
recover
();
r
!=
nil
{
slog
.
Error
(
"create_account_antigravity_privacy_panic"
,
"account_id"
,
account
.
ID
,
"recover"
,
r
)
}
}()
s
.
EnsureAntigravityPrivacy
(
context
.
Background
(),
account
)
}()
}
return
account
,
nil
}
...
...
backend/internal/service/token_refresh_service.go
View file @
1727b8df
...
...
@@ -305,6 +305,7 @@ func (s *TokenRefreshService) refreshWithRetry(ctx context.Context, account *Acc
}
// 刷新失败但 access_token 可能仍有效,尝试设置隐私
s
.
ensureOpenAIPrivacy
(
ctx
,
account
)
s
.
ensureAntigravityPrivacy
(
ctx
,
account
)
return
err
}
...
...
@@ -334,6 +335,7 @@ func (s *TokenRefreshService) refreshWithRetry(ctx context.Context, account *Acc
// 刷新失败但 access_token 可能仍有效,尝试设置隐私
s
.
ensureOpenAIPrivacy
(
ctx
,
account
)
s
.
ensureAntigravityPrivacy
(
ctx
,
account
)
// 设置临时不可调度 10 分钟(不标记 error,保持 status=active 让下个刷新周期能继续尝试)
until
:=
time
.
Now
()
.
Add
(
tokenRefreshTempUnschedDuration
)
...
...
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