From 80479b528db53a1f507d4c11efaad9abc583e490 Mon Sep 17 00:00:00 2001 From: Khash Sajadi Date: Wed, 13 Nov 2024 03:09:59 -0800 Subject: [PATCH] Include registration error in the log (#657) * Include registration error in the log * remove chatty debug log this will show in the logs every 5 seconds as debug (not even trace) which leads to a lot of noise --- periodic_task_manager.go | 4 ++-- scheduler.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/periodic_task_manager.go b/periodic_task_manager.go index 3b927dd..c0fd01e 100644 --- a/periodic_task_manager.go +++ b/periodic_task_manager.go @@ -172,8 +172,8 @@ func (mgr *PeriodicTaskManager) add(configs []*PeriodicTaskConfig) { for _, c := range configs { entryID, err := mgr.s.Register(c.Cronspec, c.Task, c.Opts...) if err != nil { - mgr.s.logger.Errorf("Failed to register periodic task: cronspec=%q task=%q", - c.Cronspec, c.Task.Type()) + mgr.s.logger.Errorf("Failed to register periodic task: cronspec=%q task=%q err=%v", + c.Cronspec, c.Task.Type(), err) continue } mgr.m[c.hash()] = entryID diff --git a/scheduler.go b/scheduler.go index ecb3c3c..0026185 100644 --- a/scheduler.go +++ b/scheduler.go @@ -334,7 +334,6 @@ func (s *Scheduler) beat() { } entries = append(entries, e) } - s.logger.Debugf("Writing entries %v", entries) if err := s.rdb.WriteSchedulerEntries(s.id, entries, s.heartbeatInterval*2); err != nil { s.logger.Warnf("Scheduler could not write heartbeat data: %v", err) }