diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-05 21:12:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-05 21:12:03 +0900 |
| commit | 2fb0b6516b9731ca832a31f6b31515f4eb056cb1 (patch) | |
| tree | e2f4f82d783799f84a111179075e3da11cdb9e80 /backend/taskqueue | |
| parent | 82d3cf35c3c6b85b48c94dd6301c8bf718669b8d (diff) | |
| download | iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.tar.gz iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.tar.zst iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.zip | |
feat(backend): support swift language
Diffstat (limited to 'backend/taskqueue')
| -rw-r--r-- | backend/taskqueue/processor.go | 2 | ||||
| -rw-r--r-- | backend/taskqueue/queue.go | 2 | ||||
| -rw-r--r-- | backend/taskqueue/tasks.go | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/backend/taskqueue/processor.go b/backend/taskqueue/processor.go index 42714f5..8dadfdf 100644 --- a/backend/taskqueue/processor.go +++ b/backend/taskqueue/processor.go @@ -39,7 +39,7 @@ func (p *processor) doProcessTaskRunTestcase( if err != nil { return nil, fmt.Errorf("json.Marshal failed: %v", err) } - req, err := http.NewRequest("POST", "http://worker-php:80/exec", bytes.NewBuffer(reqJSON)) + req, err := http.NewRequest("POST", "http://worker-"+payload.Language+":80/exec", bytes.NewBuffer(reqJSON)) if err != nil { return nil, fmt.Errorf("http.NewRequest failed: %v", err) } diff --git a/backend/taskqueue/queue.go b/backend/taskqueue/queue.go index b348fca..60844d2 100644 --- a/backend/taskqueue/queue.go +++ b/backend/taskqueue/queue.go @@ -25,6 +25,7 @@ func (q *Queue) EnqueueTaskRunTestcase( userID int, submissionID int, testcaseID int, + language string, code string, stdin string, stdout string, @@ -34,6 +35,7 @@ func (q *Queue) EnqueueTaskRunTestcase( userID, submissionID, testcaseID, + language, code, stdin, stdout, diff --git a/backend/taskqueue/tasks.go b/backend/taskqueue/tasks.go index f4cba20..943943f 100644 --- a/backend/taskqueue/tasks.go +++ b/backend/taskqueue/tasks.go @@ -17,6 +17,7 @@ type TaskPayloadRunTestcase struct { UserID int SubmissionID int TestcaseID int + Language string Code string Stdin string Stdout string @@ -27,6 +28,7 @@ func newTaskRunTestcase( userID int, submissionID int, testcaseID int, + language string, code string, stdin string, stdout string, @@ -36,6 +38,7 @@ func newTaskRunTestcase( UserID: userID, SubmissionID: submissionID, TestcaseID: testcaseID, + Language: language, Code: code, Stdin: stdin, Stdout: stdout, |
