feat: 调整日志
This commit is contained in:
@@ -121,7 +121,7 @@ func (p *KeyProvider) handleSuccess(keyID uint, keyHashKey, activeKeysListKey st
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !isActive {
|
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 {
|
if err := p.store.LRem(activeKeysListKey, 0, keyID); err != nil {
|
||||||
return fmt.Errorf("failed to LRem key before LPush on recovery: %w", err)
|
return fmt.Errorf("failed to LRem key before LPush on recovery: %w", err)
|
||||||
}
|
}
|
||||||
|
@@ -102,13 +102,17 @@ func (s *KeyCronService) submitValidationJobs() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(keys) == 0 {
|
lenKey := len(keys)
|
||||||
|
|
||||||
|
if lenKey == 0 {
|
||||||
continue
|
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 {
|
for _, key := range keys {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
@@ -129,10 +133,6 @@ func (s *KeyCronService) submitValidationJobs() {
|
|||||||
if len(groupsToUpdateTimestamp) > 0 {
|
if len(groupsToUpdateTimestamp) > 0 {
|
||||||
s.updateGroupTimestamps(groupsToUpdateTimestamp, validationStartTime)
|
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) {
|
func (s *KeyCronService) updateGroupTimestamps(groups map[uint]*models.Group, validationStartTime time.Time) {
|
||||||
|
Reference in New Issue
Block a user