mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-15 00:09:00 +01:00
Prune weed/worker/tasks (#9011)
* chore(weed/worker/tasks): prune CommonConfigGetter type * chore(weed/worker/tasks): prune BaseTask type
This commit is contained in:
1 parent
eb5624233d
commit
259e365104
2 files changed
-25
No files matched your search
@@ -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
|
||||
|
||||
@@ -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)
|
||||
Reference in new issue
Block a user