From 259e36510477172da86db7f584f08c2e99eb4c84 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Thu, 9 Apr 2026 19:00:06 -0700 Subject: [PATCH] Prune weed/worker/tasks (#9011) * chore(weed/worker/tasks): prune CommonConfigGetter type * chore(weed/worker/tasks): prune BaseTask type --- weed/worker/tasks/task.go | 18 ------------------ weed/worker/tasks/ui_base.go | 7 ------- 2 files changed, 25 deletions(-) diff --git a/weed/worker/tasks/task.go b/weed/worker/tasks/task.go index 4ce022326f..bd6961b5d0 100644 --- a/weed/worker/tasks/task.go +++ b/weed/worker/tasks/task.go @@ -1,28 +1,10 @@ package tasks import ( - "sync" - "time" - "github.com/seaweedfs/seaweedfs/weed/pb/worker_pb" "github.com/seaweedfs/seaweedfs/weed/worker/types" ) -// BaseTask provides common functionality for all tasks -type BaseTask struct { - taskType types.TaskType - taskID string - progress float64 - cancelled bool - mutex sync.RWMutex - startTime time.Time - estimatedDuration time.Duration - logger TaskLogger - loggerConfig TaskLoggerConfig - progressCallback func(float64, string) // Callback function for progress updates - currentStage string // Current stage description -} - // UnsupportedTaskTypeError represents an error for unsupported task types type UnsupportedTaskTypeError struct { TaskType types.TaskType diff --git a/weed/worker/tasks/ui_base.go b/weed/worker/tasks/ui_base.go index 265914aa6c..f77561b1ff 100644 --- a/weed/worker/tasks/ui_base.go +++ b/weed/worker/tasks/ui_base.go @@ -75,12 +75,5 @@ func (ui *BaseUIProvider) ApplyTaskConfig(config types.TaskConfig) error { return ui.applyTaskConfigFunc(config) } -// CommonConfigGetter provides a common pattern for getting current configuration -type CommonConfigGetter[T any] struct { - defaultConfig T - detectorFunc func() T - schedulerFunc func() T -} - // RegisterUIFunc provides a common registration function signature type RegisterUIFunc[D, S any] func(uiRegistry *types.UIRegistry, detector D, scheduler S)