Skip to content

Commit

Permalink
conc: disabled task runner by default; (#1113)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
selm0 authored Jun 6, 2024
1 parent d6eac98 commit 97bfb0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/conc/task_runner/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ 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
RunTask(task kernel.Module) error
}

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
Expand Down

0 comments on commit 97bfb0f

Please sign in to comment.