Add support for timeout

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
Mrunal Patel 2016-11-18 14:48:04 -08:00
parent 5c1adcbf6a
commit 78ecdcd298
2 changed files with 84 additions and 14 deletions

View file

@ -597,13 +597,13 @@ func (s *Server) ExecSync(ctx context.Context, req *pb.ExecSyncRequest) (*pb.Exe
return nil, fmt.Errorf("exec command cannot be empty")
}
out, errout, rc, err := s.runtime.ExecSync(c, cmd, req.GetTimeout())
execResp, err := s.runtime.ExecSync(c, cmd, req.GetTimeout())
resp := &pb.ExecSyncResponse{
Stdout: out,
Stderr: errout,
ExitCode: &rc,
Stdout: execResp.Stdout,
Stderr: execResp.Stderr,
ExitCode: &execResp.ExitCode,
}
logrus.Debugf("ExecSyncResponse: %+v", resp)
return resp, err
}