Switch java/exec to use Exec in Executor

This commit is contained in:
Michael Schurter
2017-04-21 16:20:37 -07:00
parent ba1c2e7936
commit 90f5e232a5
6 changed files with 98 additions and 7 deletions

View File

@@ -390,7 +390,12 @@ func (h *javaHandle) Update(task *structs.Task) error {
}
func (h *javaHandle) Exec(ctx context.Context, cmd string, args []string) ([]byte, int, error) {
return execChroot(ctx, h.taskDir, cmd, args)
deadline, ok := ctx.Deadline()
if !ok {
// No deadline set on context; default to 1 minute
deadline = time.Now().Add(time.Minute)
}
return h.executor.Exec(deadline, cmd, args)
}
func (h *javaHandle) Signal(s os.Signal) error {