From d430870dc56d3ab3efd9d78dbc2b316a64311b05 Mon Sep 17 00:00:00 2001 From: tbphp Date: Fri, 11 Jul 2025 22:12:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/keypool/provider.go | 2 +- internal/services/key_cron_service.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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) {