aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/taskqueue/tasks.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/taskqueue/tasks.go')
-rw-r--r--backend/taskqueue/tasks.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/backend/taskqueue/tasks.go b/backend/taskqueue/tasks.go
index 2891a36..cd67948 100644
--- a/backend/taskqueue/tasks.go
+++ b/backend/taskqueue/tasks.go
@@ -10,20 +10,17 @@ const (
TaskTypeExec = "exec"
)
-type Testcase struct {
- Stdin string
- Stdout string
-}
-
type TaskExecPlayload struct {
- Code string
- Testcases []*Testcase
+ GameID int
+ UserID int
+ Code string
}
-func NewExecTask(code string, testcases []*Testcase) (*asynq.Task, error) {
+func NewExecTask(gameID, userID int, code string) (*asynq.Task, error) {
payload, err := json.Marshal(TaskExecPlayload{
- Code: code,
- Testcases: testcases,
+ GameID: gameID,
+ UserID: userID,
+ Code: code,
})
if err != nil {
return nil, err