Skip to content

Commit 54447d2

Browse files
Merge pull request #25 from abhishek97/runModes
Keep callback response consistent
2 parents 13ba6c6 + 3f94608 commit 54447d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/routes/api/run.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const handleSuccessForSubmission = function (result: RunResponse) {
6262
// send a post request to callback
6363
(async () => {
6464
// 1. upload the result to s3 and get the url
65+
const code = result.stderr ? 400 : 200
6566
const {url} = await upload(result)
6667

6768
// 2. save the url in db
@@ -74,7 +75,7 @@ const handleSuccessForSubmission = function (result: RunResponse) {
7475
})
7576

7677
// make the callback request
77-
await axios.post(job.callback, {id: result.id, outputs: [url]})
78+
await axios.post(job.callback, {id: result.id, code, outputs: [url]})
7879
})()
7980
break;
8081
}
@@ -138,6 +139,7 @@ const getRunPoolElement = function (body: RunRequestBody, res: Response): RunPoo
138139
* HTTP/1.1 200 OK
139140
* {
140141
* "id": 10,
142+
* "code": 200,
141143
* "outputs": ["http://localhost/judge-submissions/file.json"]
142144
* }
143145
*/

0 commit comments

Comments
 (0)