Skip to content

Commit b2855b5

Browse files
Apply Papeador multi-language support (#15)
* Create containers to run programs in many languages * Use an worker channel in order to queue running jobs Co-authored-by: OhhhMyGucci <94269402+OhhhMyGucci@users.noreply.github.com>
1 parent b3e2330 commit b2855b5

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

api/submit.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ func (api *ApiContext) submitProgram(w http.ResponseWriter, r *http.Request) {
9191
// Metelo de nuevo
9292
*judge.WorkerQueueP <- worker
9393

94+
i := 0
95+
for scanner.Scan() {
96+
res := scanner.Text()
97+
log.Printf("Testcase %v: %v", i, res)
98+
resMap[i] = res
99+
i++
100+
}
101+
102+
// Metelo de nuevo
103+
*judge.WorkerQueueP <- worker
104+
94105
w.Header().Set("Content-Type", "application/json")
95106
w.WriteHeader(http.StatusOK)
96107
json.NewEncoder(w).Encode(resMap)

0 commit comments

Comments
 (0)