From f5c95535654f12a40bed19f97e4f81e968aa1e7a Mon Sep 17 00:00:00 2001 From: KevinWu0904 <37426896+KevinWu0904@users.noreply.github.com> Date: Fri, 27 Aug 2021 00:17:29 +0800 Subject: [PATCH] fix: wait all jobs done (#1010) Signed-off-by: KevinWu0904 --- dkron/scheduler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkron/scheduler.go b/dkron/scheduler.go index e8900ab5d..62c640038 100644 --- a/dkron/scheduler.go +++ b/dkron/scheduler.go @@ -77,7 +77,7 @@ func (s *Scheduler) Stop() { if s.started { s.logger.Debug("scheduler: Stopping scheduler") - s.Cron.Stop() + <- s.Cron.Stop().Done() s.started = false // Keep Cron exists and let the jobs which have been scheduled can continue to finish, // even the node's leadership will be revoked.