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
e12dd079
Commit
e12dd079
authored
Jan 28, 2026
by
shaw
Browse files
修复调度器空缓存导致的竞态条件bug
当新分组创建后立即绑定账号时,调度器会错误地将空快照视为有效缓存命中, 导致返回没有可调度的账号。现在空快照会触发数据库回退查询。
parent
269a6592
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/repository/scheduler_cache.go
View file @
e12dd079
...
@@ -58,7 +58,9 @@ func (c *schedulerCache) GetSnapshot(ctx context.Context, bucket service.Schedul
...
@@ -58,7 +58,9 @@ func (c *schedulerCache) GetSnapshot(ctx context.Context, bucket service.Schedul
return
nil
,
false
,
err
return
nil
,
false
,
err
}
}
if
len
(
ids
)
==
0
{
if
len
(
ids
)
==
0
{
return
[]
*
service
.
Account
{},
true
,
nil
// 空快照视为缓存未命中,触发数据库回退查询
// 这解决了新分组创建后立即绑定账号时的竞态条件问题
return
nil
,
false
,
nil
}
}
keys
:=
make
([]
string
,
0
,
len
(
ids
))
keys
:=
make
([]
string
,
0
,
len
(
ids
))
...
...
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