Prune weed/worker/tasks (#9011)

* chore(weed/worker/tasks): prune CommonConfigGetter type

* chore(weed/worker/tasks): prune BaseTask type
This commit is contained in:
Lars Lehtonen authored and GitHub committed 2026-04-09 19:00:06 -07:00
1 parent eb5624233d
commit 259e365104
2 files changed
-25

No files matched your search

-18
View File
@@ -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
-7
View File
@@ -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)