From e0f4ccc46c8601f322640b72e100f973a837ef02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Sun, 16 Feb 2020 18:07:36 +0000 Subject: server kills subprocesses correctly on cancel --- internal/clients/runclient.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/clients/runclient.go') 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 } -- cgit v1.2.3