Skip to content

Commit df55148

Browse files
authored
Merge pull request #31 from pfnet-research/fix-default-timeout-in-configfile
fix 'worker.taskHandler.defaultTimeout' and `--default-command-timeout` are ignored
2 parents c1dfb99 + 2be0cd8 commit df55148

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/start_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func init() {
9494
viperBindPFlag("Worker.Concurrency", strconv.Itoa(cmdOpts.Worker.Concurrency), flag.Lookup("concurrency"))
9595

9696
flag.Duration("default-command-timeout", cmdOpts.Worker.TaskHandler.DefaultCommandTimeout, "default timeout for executing command for tasks. the value will be used when the taskspec has no timeout spec")
97-
viperBindPFlag("Worker.TaskHandler.DefaultCommandTimeout", cmdOpts.Worker.TaskHandler.DefaultCommandTimeout.String(), flag.Lookup("default-command-timeout"))
97+
viperBindPFlag("Worker.TaskHandler.DefaultTimeout", cmdOpts.Worker.TaskHandler.DefaultCommandTimeout.String(), flag.Lookup("default-command-timeout"))
9898

9999
flag.Bool("exit-on-suspend", cmdOpts.Worker.ExitOnSuspend, "if set, worker exits when queue is suspended")
100100
viperBindPFlag("Worker.ExitOnSuspend", strconv.FormatBool(cmdOpts.Worker.ExitOnSuspend), flag.Lookup("exit-on-suspend"))

pkg/apis/worker/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type WorkerSpec struct {
7474
}
7575

7676
type TaskHandlerSpec struct {
77-
DefaultCommandTimeout time.Duration `json:"defaultTimeout" yaml:"defaultTimeout" default:"30m" validate:"required"`
77+
DefaultCommandTimeout time.Duration `json:"defaultTimeout" yaml:"defaultTimeout" mapstructure:"defaultTimeout" default:"30m" validate:"required"`
7878
Commands []string `json:"commands" yaml:"commands" default:"[\"cat\"]" validate:"required"`
7979
}
8080

0 commit comments

Comments
 (0)