Explorar o código

Fixed bug of timeout being hardcoded

jamesread %!s(int64=5) %!d(string=hai) anos
pai
achega
800598b199
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      internal/executor/executor.go

+ 1 - 1
internal/executor/executor.go

@@ -39,7 +39,7 @@ func execAction(cfg *config.Config, actualAction *config.ActionButton) *pb.Start
 		"timeout": actualAction.Timeout,
 	}).Infof("Found action")
 
-	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
+	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(actualAction.Timeout) * time.Second)
 	defer cancel()
 
 	cmd := exec.CommandContext(ctx, "sh", "-c", actualAction.Shell)