diff options
Diffstat (limited to 'weed/command/worker.go')
| -rw-r--r-- | weed/command/worker.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/weed/command/worker.go b/weed/command/worker.go index 6e592f73f..2d268e61d 100644 --- a/weed/command/worker.go +++ b/weed/command/worker.go @@ -16,9 +16,7 @@ import ( "github.com/seaweedfs/seaweedfs/weed/worker/types" // Import task packages to trigger their auto-registration - _ "github.com/seaweedfs/seaweedfs/weed/worker/tasks/balance" _ "github.com/seaweedfs/seaweedfs/weed/worker/tasks/erasure_coding" - _ "github.com/seaweedfs/seaweedfs/weed/worker/tasks/vacuum" ) var cmdWorker = &Command{ @@ -41,7 +39,7 @@ Examples: var ( workerAdminServer = cmdWorker.Flag.String("admin", "localhost:23646", "admin server address") - workerCapabilities = cmdWorker.Flag.String("capabilities", "vacuum,ec,remote,replication,balance", "comma-separated list of task types this worker can handle") + workerCapabilities = cmdWorker.Flag.String("capabilities", "ec_vacuum,erasure_coding", "comma-separated list of task types this worker can handle") workerMaxConcurrent = cmdWorker.Flag.Int("maxConcurrent", 2, "maximum number of concurrent tasks") workerHeartbeatInterval = cmdWorker.Flag.Duration("heartbeat", 30*time.Second, "heartbeat interval") workerTaskRequestInterval = cmdWorker.Flag.Duration("taskInterval", 5*time.Second, "task request interval") @@ -109,6 +107,9 @@ func runWorker(cmd *Command, args []string) bool { // Create gRPC dial option using TLS configuration grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.worker") + // Initialize dynamic task type functions now that all tasks are registered + tasks.InitializeDynamicTaskTypes() + // Create worker configuration config := &types.WorkerConfig{ AdminServer: *workerAdminServer, @@ -193,17 +194,6 @@ func parseCapabilities(capabilityStr string) []types.TaskType { capabilityMap[strings.ToLower(string(taskType))] = taskType } - // Add common aliases for convenience - if taskType, exists := capabilityMap["erasure_coding"]; exists { - capabilityMap["ec"] = taskType - } - if taskType, exists := capabilityMap["remote_upload"]; exists { - capabilityMap["remote"] = taskType - } - if taskType, exists := capabilityMap["fix_replication"]; exists { - capabilityMap["replication"] = taskType - } - var capabilities []types.TaskType parts := strings.Split(capabilityStr, ",") |
