diff --git a/internal/keypool/provider.go b/internal/keypool/provider.go index 2057915..11b40d0 100644 --- a/internal/keypool/provider.go +++ b/internal/keypool/provider.go @@ -121,7 +121,7 @@ func (p *KeyProvider) handleSuccess(keyID uint, keyHashKey, activeKeysListKey st } if !isActive { - logrus.WithField("keyID", keyID).Info("Key has recovered and is being restored to active pool.") + logrus.WithField("keyID", keyID).Debug("Key has recovered and is being restored to active pool.") if err := p.store.LRem(activeKeysListKey, 0, keyID); err != nil { return fmt.Errorf("failed to LRem key before LPush on recovery: %w", err) } diff --git a/internal/services/key_cron_service.go b/internal/services/key_cron_service.go index a5580a4..69c1574 100644 --- a/internal/services/key_cron_service.go +++ b/internal/services/key_cron_service.go @@ -102,13 +102,17 @@ func (s *KeyCronService) submitValidationJobs() { continue } - if len(keys) == 0 { + lenKey := len(keys) + + if lenKey == 0 { continue } - total += len(keys) + total += lenKey - logrus.Infof("KeyCronService: Submitting %d keys for group %s for validation.", len(keys), group.Name) + if lenKey > 0 { + logrus.Infof("KeyCronService: Submitting %d keys for group %s for validation.", lenKey, group.Name) + } for _, key := range keys { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) @@ -129,10 +133,6 @@ func (s *KeyCronService) submitValidationJobs() { if len(groupsToUpdateTimestamp) > 0 { s.updateGroupTimestamps(groupsToUpdateTimestamp, validationStartTime) } - - if total > 0 { - logrus.Infof("KeyCronService: Submitted %d keys for validation across %d groups.", total, len(groupsToUpdateTimestamp)) - } } func (s *KeyCronService) updateGroupTimestamps(groups map[uint]*models.Group, validationStartTime time.Time) {