From 97bfb0f07ceda232586f5ddfb06408a55a1f4b2a Mon Sep 17 00:00:00 2001 From: selmo <7098214+selm0@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:33:28 +0200 Subject: [PATCH] conc: disabled task runner by default; (#1113) Make the task runner opt-in. This change also makes the runner a background module, so it doesn't prevent application shutdown if there are no tasks left. --- pkg/conc/task_runner/task_runner.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/conc/task_runner/task_runner.go b/pkg/conc/task_runner/task_runner.go index a7be451dc..d86803573 100644 --- a/pkg/conc/task_runner/task_runner.go +++ b/pkg/conc/task_runner/task_runner.go @@ -18,6 +18,8 @@ import ( // // Try to avoid using this module if possible. It is only meant as a last resort. // +// Enable it by setting task_runner.enabled = true +// //go:generate mockery --name TaskRunner type TaskRunner interface { kernel.Module @@ -25,10 +27,11 @@ type TaskRunner interface { } type Settings struct { - Enabled bool `cfg:"enabled" default:"true"` + Enabled bool `cfg:"enabled" default:"false"` } type taskRunner struct { + kernel.BackgroundModule lck sync.Mutex done bool pendingTasks chan kernel.Module