mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 14:56:36 +00:00
feat(judge): create testcaseResult for TLE and update relation field
This commit is contained in:
parent
675c828fe2
commit
b18dedcc23
@ -423,6 +423,14 @@ async function run(
|
||||
// Timeout mechanism
|
||||
const timeoutId = setTimeout(async () => {
|
||||
stream.destroy(); // Destroy the stream to stop execution
|
||||
await prisma.testcaseResult.create({
|
||||
data: {
|
||||
isCorrect: false,
|
||||
output: "",
|
||||
submissionId,
|
||||
testcaseId: testcase.id,
|
||||
}
|
||||
})
|
||||
const updatedSubmission = await prisma.submission.update({
|
||||
where: { id: submissionId },
|
||||
data: {
|
||||
@ -510,7 +518,7 @@ async function run(
|
||||
message: "Wrong Answer",
|
||||
},
|
||||
include: {
|
||||
TestcaseResult: true,
|
||||
testcaseResults: true,
|
||||
}
|
||||
});
|
||||
return finalSubmission;
|
||||
@ -529,7 +537,7 @@ async function run(
|
||||
memoryUsage: maxMemoryUsage / 1024 / 1024,
|
||||
},
|
||||
include: {
|
||||
TestcaseResult: true,
|
||||
testcaseResults: true,
|
||||
}
|
||||
});
|
||||
return finalSubmission;
|
||||
|
Loading…
Reference in New Issue
Block a user