aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/game/hub.go2
-rw-r--r--backend/taskqueue/processor.go24
-rw-r--r--backend/taskqueue/tasks.go2
3 files changed, 14 insertions, 14 deletions
diff --git a/backend/game/hub.go b/backend/game/hub.go
index ef69ddb..27a9847 100644
--- a/backend/game/hub.go
+++ b/backend/game/hub.go
@@ -209,7 +209,7 @@ func (hub *gameHub) processTaskResults() {
Type: playerMessageTypeS2CExecResult,
Data: playerMessageS2CExecResultPayload{
Score: nil,
- Status: api.GamePlayerMessageS2CExecResultPayloadStatus(taskResult.Result),
+ Status: api.GamePlayerMessageS2CExecResultPayloadStatus(taskResult.Status),
},
}
}
diff --git a/backend/taskqueue/processor.go b/backend/taskqueue/processor.go
index f789e2e..135a7d2 100644
--- a/backend/taskqueue/processor.go
+++ b/backend/taskqueue/processor.go
@@ -49,7 +49,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
Code string `json:"code"`
}
type swiftcResponseData struct {
- Result string `json:"result"`
+ Status string `json:"status"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
@@ -69,7 +69,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
if err := json.NewDecoder(res.Body).Decode(&resData); err != nil {
return fmt.Errorf("json.Decode failed: %v", err)
}
- if resData.Result != "success" {
+ if resData.Status != "success" {
err := p.q.CreateTestcaseResult(ctx, db.CreateTestcaseResultParams{
SubmissionID: submissionID,
TestcaseID: nil,
@@ -82,7 +82,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
}
p.results <- TaskExecResult{
Task: &payload,
- Result: "compile_error",
+ Status: "compile_error",
}
return fmt.Errorf("swiftc failed: %v", resData.Stderr)
}
@@ -93,7 +93,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
Code string `json:"code"`
}
type wasmcResponseData struct {
- Result string `json:"result"`
+ Status string `json:"status"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
@@ -113,7 +113,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
if err := json.NewDecoder(res.Body).Decode(&resData); err != nil {
return fmt.Errorf("json.Decode failed: %v", err)
}
- if resData.Result != "success" {
+ if resData.Status != "success" {
err := p.q.CreateTestcaseResult(ctx, db.CreateTestcaseResultParams{
SubmissionID: submissionID,
TestcaseID: nil,
@@ -126,7 +126,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
}
p.results <- TaskExecResult{
Task: &payload,
- Result: "compile_error",
+ Status: "compile_error",
}
return fmt.Errorf("wasmc failed: %v", resData.Stderr)
}
@@ -144,7 +144,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
Stdin string `json:"stdin"`
}
type testrunResponseData struct {
- Result string `json:"result"`
+ Status string `json:"status"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
@@ -165,11 +165,11 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
if err := json.NewDecoder(res.Body).Decode(&resData); err != nil {
return fmt.Errorf("json.Decode failed: %v", err)
}
- if resData.Result != "success" {
+ if resData.Status != "success" {
err := p.q.CreateTestcaseResult(ctx, db.CreateTestcaseResultParams{
SubmissionID: submissionID,
TestcaseID: testcase.TestcaseID,
- Status: resData.Result,
+ Status: resData.Status,
Stdout: resData.Stdout,
Stderr: resData.Stderr,
})
@@ -178,7 +178,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
}
p.results <- TaskExecResult{
Task: &payload,
- Result: resData.Result,
+ Status: resData.Status,
}
return fmt.Errorf("testrun failed: %v", resData.Stderr)
}
@@ -195,7 +195,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
}
p.results <- TaskExecResult{
Task: &payload,
- Result: "wrong_answer",
+ Status: "wrong_answer",
}
return fmt.Errorf("testrun failed: %v", resData.Stdout)
}
@@ -203,7 +203,7 @@ func (p *ExecProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
p.results <- TaskExecResult{
Task: &payload,
- Result: "success",
+ Status: "success",
}
return nil
}
diff --git a/backend/taskqueue/tasks.go b/backend/taskqueue/tasks.go
index db05553..5c518f4 100644
--- a/backend/taskqueue/tasks.go
+++ b/backend/taskqueue/tasks.go
@@ -30,7 +30,7 @@ func NewExecTask(gameID, userID int, code string) (*asynq.Task, error) {
type TaskExecResult struct {
Task *TaskExecPlayload
- Result string
+ Status string
Stdout string
Stderr string
}