diff --git a/go/storage/store_task.go b/go/storage/store_task.go index 123b12f5f..34ac8b07a 100644 --- a/go/storage/store_task.go +++ b/go/storage/store_task.go @@ -8,12 +8,10 @@ import ( "github.com/chrislusf/seaweedfs/go/glog" ) -type TaskType string - const ( - TaskVacuum TaskType = "VACUUM" - TaskReplica TaskType = "REPLICA" - TaskBalance TaskType = "BALANCE" + TaskVacuum = "VACUUM" + TaskReplica = "REPLICA" + TaskBalance = "BALANCE" ) var ( @@ -87,7 +85,7 @@ func (tm *TaskManager) NewTask(s *Store, args url.Values) (tid string, e error) return tid, ErrTaskExists } var tw TaskWorker - switch TaskType(tt) { + switch tt { case TaskVacuum: tw, e = NewVacuumTask(s, args) case TaskReplica: diff --git a/go/storage/store_task_cli.go b/go/storage/store_task_cli.go index fb69fed39..6457a8806 100644 --- a/go/storage/store_task_cli.go +++ b/go/storage/store_task_cli.go @@ -20,9 +20,9 @@ type TaskCli struct { DataNode string } -func NewTaskCli(dataNode string, task TaskType, params TaskParams) (*TaskCli, error) { +func NewTaskCli(dataNode string, task string, params TaskParams) (*TaskCli, error) { args := url.Values{} - args.Set("task", string(task)) + args.Set("task", task) for k, v := range params { args.Set(k, v) }