summaryrefslogtreecommitdiff
path: root/internal/clients/runclient.go
diff options
context:
space:
mode:
authorPaul Bütow <pbuetow@mimecast.com>2020-02-16 18:07:36 +0000
committerPaul Bütow <pbuetow@mimecast.com>2020-02-16 18:07:36 +0000
commite0f4ccc46c8601f322640b72e100f973a837ef02 (patch)
tree61a1fcf66daea222da19500b0b6ae60d1e89a5d9 /internal/clients/runclient.go
parent6bca637513e065a33cadaccad97ada25eb7a6b00 (diff)
server kills subprocesses correctly on cancel
Diffstat (limited to 'internal/clients/runclient.go')
-rw-r--r--internal/clients/runclient.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/clients/runclient.go b/internal/clients/runclient.go
index 7a62fcc..e3be616 100644
--- a/internal/clients/runclient.go
+++ b/internal/clients/runclient.go
@@ -35,6 +35,11 @@ func (c RunClient) makeHandler(server string) handlers.Handler {
func (c RunClient) makeCommands() (commands []string) {
// Send "run COMMAND" to server!
+ if c.Timeout > 0 {
+ commands = append(commands, fmt.Sprintf("timeout %d %s %s", c.Timeout, c.Mode.String(), c.What))
+ return
+ }
+
commands = append(commands, fmt.Sprintf("%s %s", c.Mode.String(), c.What))
return
}