mirror of
https://github.com/kemko/nomad.git
synced 2026-01-10 04:15:41 +03:00
Fixed the executor command
This commit is contained in:
32
client/driver/plugins/executor_basic.go
Normal file
32
client/driver/plugins/executor_basic.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// +build !linux
|
||||
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
type BasicExecutor struct {
|
||||
}
|
||||
|
||||
func NewExecutor() Executor {
|
||||
return &BasicExecutor{}
|
||||
}
|
||||
|
||||
func (e *BasicExecutor) LaunchCmd(cmd *exec.Cmd, ctx *ExecutorContext) (*ProcessState, error) {
|
||||
return &ProcessState{Pid: 5, ExitCode: -1, Time: time.Now()}, nil
|
||||
}
|
||||
|
||||
func (e *BasicExecutor) Wait() (*ProcessState, error) {
|
||||
time.Sleep(5 * time.Second)
|
||||
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
|
||||
}
|
||||
|
||||
func (e *BasicExecutor) Exit() (*ProcessState, error) {
|
||||
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
|
||||
}
|
||||
|
||||
func (e *BasicExecutor) ShutDown() (*ProcessState, error) {
|
||||
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user