diff --git a/src/routes/api/run.ts b/src/routes/api/run.ts index c07e82b..0d12365 100644 --- a/src/routes/api/run.ts +++ b/src/routes/api/run.ts @@ -61,6 +61,7 @@ const handleSuccessForSubmission = function (result: RunResponse) { // send a post request to callback (async () => { // 1. upload the result to s3 and get the url + const code = result.stderr ? 400 : 200 const {url} = await upload(result) // 2. save the url in db @@ -73,7 +74,7 @@ const handleSuccessForSubmission = function (result: RunResponse) { }) // make the callback request - await axios.post(job.callback, {id: result.id, outputs: [url]}) + await axios.post(job.callback, {id: result.id, code, outputs: [url]}) })() break; } @@ -136,6 +137,7 @@ const getRunPoolElement = function (body: RunRequestBody, res: Response): RunPoo * HTTP/1.1 200 OK * { * "id": 10, + * "code": 200, * "outputs": ["http://localhost/judge-submissions/file.json"] * } */