aboutsummaryrefslogtreecommitdiffhomepage
path: root/worker/exec.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-12 05:54:49 +0900
committernsfisis <nsfisis@gmail.com>2024-08-12 05:54:49 +0900
commit3074f8d74330a2c238040755b758230d682a4bc4 (patch)
tree3c45267ee25aa78be1ad4c31e0c09894e656b506 /worker/exec.go
parent7527e54bba0c528015ce402bfa4534c1ab6ca1da (diff)
parentb37d6f213c2f3b19631e5067f39a7106859faaed (diff)
downloadphperkaigi-2025-albatross-3074f8d74330a2c238040755b758230d682a4bc4.tar.gz
phperkaigi-2025-albatross-3074f8d74330a2c238040755b758230d682a4bc4.tar.zst
phperkaigi-2025-albatross-3074f8d74330a2c238040755b758230d682a4bc4.zip
Merge branch 'feat/play-page'
Diffstat (limited to 'worker/exec.go')
-rw-r--r--worker/exec.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/worker/exec.go b/worker/exec.go
index 9e937f7..37f542b 100644
--- a/worker/exec.go
+++ b/worker/exec.go
@@ -67,11 +67,14 @@ func execCommandWithTimeout(
}
}
-func convertCommandErrorToResultType(err error) string {
+func convertCommandErrorToResultType(err error, isCompile bool) string {
if err != nil {
if err == context.DeadlineExceeded {
return resultTimeout
}
+ if isCompile {
+ return resultCompileError
+ }
return resultRuntimeError
}
return resultSuccess
@@ -109,7 +112,7 @@ func execSwiftCompile(
)
return swiftCompileResponseData{
- Status: convertCommandErrorToResultType(err),
+ Status: convertCommandErrorToResultType(err, true),
Stdout: stdout,
Stderr: stderr,
}
@@ -140,7 +143,7 @@ func execWasmCompile(
)
return wasmCompileResponseData{
- Status: convertCommandErrorToResultType(err),
+ Status: convertCommandErrorToResultType(err, true),
Stdout: stdout,
Stderr: stderr,
}
@@ -170,7 +173,7 @@ func execTestRun(
)
return testRunResponseData{
- Status: convertCommandErrorToResultType(err),
+ Status: convertCommandErrorToResultType(err, false),
Stdout: stdout,
Stderr: stderr,
}