feat: 优化代码
This commit is contained in:
@@ -39,7 +39,7 @@ func NewKeyCronService(
|
||||
|
||||
// Start begins the cron job execution.
|
||||
func (s *KeyCronService) Start() {
|
||||
logrus.Info("Starting KeyCronService...")
|
||||
logrus.Debug("Starting KeyCronService...")
|
||||
s.wg.Add(1)
|
||||
go s.runLoop()
|
||||
}
|
||||
|
@@ -170,7 +170,7 @@ func (s *LeaderService) maintainLeadershipLoop() {
|
||||
ticker := time.NewTicker(leaderRenewalInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
logrus.Info("Leadership maintenance loop started.")
|
||||
logrus.Debug("Leadership maintenance loop started.")
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
@@ -200,7 +200,7 @@ func (s *LeaderService) tryToBeLeader() error {
|
||||
return fmt.Errorf("failed to acquire lock: %w", err)
|
||||
}
|
||||
if acquired {
|
||||
logrus.WithField("nodeID", s.nodeID).Info("Successfully acquired leadership.")
|
||||
logrus.WithField("nodeID", s.nodeID).Debug("Successfully acquired leadership.")
|
||||
s.isLeader.Store(true)
|
||||
}
|
||||
return nil
|
||||
|
@@ -30,7 +30,7 @@ func NewLogCleanupService(db *gorm.DB, settingsManager *config.SystemSettingsMan
|
||||
// Start 启动日志清理服务
|
||||
func (s *LogCleanupService) Start() {
|
||||
go s.run()
|
||||
logrus.Info("Log cleanup service started")
|
||||
logrus.Debug("Log cleanup service started")
|
||||
}
|
||||
|
||||
// Stop 停止日志清理服务
|
||||
|
Reference in New Issue
Block a user