Skip to content

Commit 3c8a58b

Browse files
improved logging
1 parent e7313c5 commit 3c8a58b

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
"cout",
77
"ctxdl",
88
"endl",
9+
"errr",
10+
"errw",
911
"hjresp",
1012
"kvdb",
1113
"lpthread",
14+
"outr",
1215
"prepend",
1316
"printf",
1417
"stdc",

backend/internal/api/setup_router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func SetupRouter(cc *core.CoreController) *gin.Engine {
4343

4444
cc.GradeQueue <- gr
4545

46-
c.Header("Location", ApiPrefix+gr.Id)
46+
c.Header("Location", ApiPrefix+"/result/"+gr.Id)
4747
c.Status(202)
4848

4949
})

backend/internal/grader/compile_user_code.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func CompileUserCode(ctx context.Context, gr types.GradeRequest, tmpDir string)
6060
"CXX=g++",
6161
"CXXFLAGS=-std=c++11",
6262
},
63+
Tty: true,
6364
}, &container.HostConfig{
6465
Binds: []string{tmpDir + ":/data"},
6566
NetworkMode: "none",

backend/internal/grader/exec_user_code.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func ExecUserCode(ctx context.Context, gr types.GradeRequest, tmpDir string) (*E
6262
Env: []string{
6363
"TEST_CASE_DIR=" + filepath.Join("/code-grader/testcases", gr.TestCaseName),
6464
},
65+
Tty: true,
6566
}, &container.HostConfig{
6667
NetworkMode: "none",
6768
Binds: []string{tmpDir + ":/data"},

0 commit comments

Comments
 (0)