diff options
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, |
