소스 검색

Fixed bug of timeout being hardcoded

jamesread 5 년 전
부모
커밋
800598b199
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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)