fix(grok): 修复调度阈值初始化与刷新测试回归

This commit is contained in:
IanShaw027
2026-08-07 16:10:31 +08:00
parent 2a256150f7
commit a061a758f4
2 changed files with 27 additions and 7 deletions
@@ -107,6 +107,24 @@ func (r *grokReconcileRepo) UpdateCredentials(_ context.Context, id int64, crede
return nil
}
func (r *grokReconcileRepo) UpdateExtra(_ context.Context, id int64, updates map[string]any) error {
r.mu.Lock()
defer r.mu.Unlock()
for i := range r.accounts {
if r.accounts[i].ID != id {
continue
}
if r.accounts[i].Extra == nil {
r.accounts[i].Extra = make(map[string]any)
}
for key, value := range updates {
r.accounts[i].Extra[key] = value
}
break
}
return nil
}
func (r *grokReconcileRepo) SetError(_ context.Context, id int64, message string) error {
r.mu.Lock()
defer r.mu.Unlock()