feat: key检测重试功能

This commit is contained in:
tbphp
2025-07-05 20:54:57 +08:00
parent 8f2a0c1afc
commit adfaf3c1e7
3 changed files with 41 additions and 42 deletions

View File

@@ -56,7 +56,7 @@ func (s *KeyCronService) run() {
// Dynamically get the interval for the next run
intervalMinutes := s.SettingsManager.GetInt("key_validation_interval_minutes", 60)
if intervalMinutes <= 0 {
intervalMinutes = 60 // Fallback to a safe default
intervalMinutes = 60
}
nextRunTimer := time.NewTimer(time.Duration(intervalMinutes) * time.Minute)
@@ -84,6 +84,7 @@ func (s *KeyCronService) validateAllGroups(ctx context.Context) {
// Get effective settings for the group
effectiveSettings := s.SettingsManager.GetEffectiveConfig(g.Config)
interval := time.Duration(effectiveSettings.KeyValidationIntervalMinutes) * time.Minute
logrus.Infof("KeyCronService: Validating group %s with interval %s", g.Name, interval)
// Check if it's time to validate this group
if g.LastValidatedAt == nil || time.Since(*g.LastValidatedAt) > interval {