From ba5967213618c3fe57186f3b1c99f944235c73b2 Mon Sep 17 00:00:00 2001 From: Patrick Pacher Date: Tue, 25 Aug 2020 14:27:40 +0200 Subject: [PATCH] Fix updates restart task not being started --- updates/main.go | 2 ++ updates/restart.go | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/updates/main.go b/updates/main.go index d68461bf..b7e27963 100644 --- a/updates/main.go +++ b/updates/main.go @@ -109,6 +109,8 @@ func prep() error { func start() error { initConfig() + restartTask = module.NewTask("automatic restart", automaticRestart).MaxDelay(10 * time.Minute) + if err := module.RegisterEventHook( "config", "config change", diff --git a/updates/restart.go b/updates/restart.go index 5dec184a..8aeb7f4a 100644 --- a/updates/restart.go +++ b/updates/restart.go @@ -20,10 +20,6 @@ var ( restartTriggered = abool.New() ) -func init() { - restartTask = module.NewTask("automatic restart", automaticRestart).MaxDelay(10 * time.Minute) -} - // DelayedRestart triggers a restart of the application by shutting down the // module system gracefully and returning with RestartExitCode. The restart // may be further delayed by up to 10 minutes by the internal task scheduling