]> git.giacomolli.uk - onechat/blobdiff - tools.go
Name timeouts for the operations they limit
[onechat] / tools.go
index 96cbb97d38010e9d6e53871b7bef0c471dba5dcf..bbd34cf67a7c82389e35aca4944bab7e33024fff 100644 (file)
--- a/tools.go
+++ b/tools.go
@@ -27,9 +27,9 @@ const (
        // output, enough for toolClipCharacters/2 characters of 4 bytes.
        toolClipBytes = 4 * toolClipCharacters / 2
 
        // output, enough for toolClipCharacters/2 characters of 4 bytes.
        toolClipBytes = 4 * toolClipCharacters / 2
 
-       // toolShellWaitDelay is how long a command can keep its output open
+       // toolShellOutputTimeout is how long a command can keep its output open
        // after it ends or after its kill.
        // after it ends or after its kill.
-       toolShellWaitDelay = 2 * time.Second
+       toolShellOutputTimeout = 2 * time.Second
 )
 
 // ToolLog is the log that the tools write their calls and results to.
 )
 
 // ToolLog is the log that the tools write their calls and results to.
@@ -379,7 +379,7 @@ func (b *Toolbox) shell(ctx context.Context, command string) string {
        cmd.Cancel = func() error {
                return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
        }
        cmd.Cancel = func() error {
                return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
        }
-       cmd.WaitDelay = toolShellWaitDelay
+       cmd.WaitDelay = toolShellOutputTimeout
 
        output := &ToolHeadTail{}
        cmd.Stdout = output
 
        output := &ToolHeadTail{}
        cmd.Stdout = output