Fix Codex exhausted snapshot propagation

This commit is contained in:
ius
2026-03-11 15:47:39 +08:00
parent 2694149489
commit 2fc6aaf936
5 changed files with 248 additions and 30 deletions

View File

@@ -4102,6 +4102,9 @@ func (s *OpenAIGatewayService) updateCodexUsageSnapshot(ctx context.Context, acc
return
}
shouldPersistUpdates := len(updates) > 0 && s.getCodexSnapshotThrottle().Allow(accountID, now)
if !shouldPersistUpdates && resetAt == nil {
return
}
go func() {
updateCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)