Skip to content

Commit

Permalink
🐛 (wrong condition impairing producer functionalities):
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaNecron committed Nov 26, 2023
1 parent 4258300 commit 7b0ac9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions worker/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ func (jc *JudgeRunner) Judge(sub types.Submission, ctx context.Context, announce
return &types.FinalResult{Verdict: types.FinalCompileError, CompilerOutput: compOut}
}
fv, p, e := jc.Run(rt, sub, announce, outPath, callback, ctx)
if e != nil {

}
return &types.FinalResult{
Verdict: fv,
CompilerOutput: compOut,
Expand Down
8 changes: 5 additions & 3 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ func (w *JudgeWorker) Judge(r *_runner, sub types.Submission) {
r.currentSubmission.Store(sub.ID)
// TODO: immediately halt runner when getting error
judge := r.Judge(sub, r.ctx, func(caseId uint16) bool {
return prod.Report(types.ResultAnnouncement, caseId) != nil
return prod.Report(types.ResultAnnouncement, caseId) == nil
}, func(r types.CaseResult) bool {
return prod.Report(types.ResultCase, r) == nil
})
finalResult := judge()
// replace actual new line characters with \\n to avoid shattered payloads when serializing response with msgpack
finalResult.CompilerOutput = strings.ReplaceAll(finalResult.CompilerOutput, "\n", "\\n")
if finalResult != nil {
// replace actual new line characters with \\n to avoid shattered payloads when serializing response with msgpack
finalResult.CompilerOutput = strings.ReplaceAll(finalResult.CompilerOutput, "\n", "\\n")
}
prod.Report(types.ResultFinal, finalResult)
}

Expand Down

0 comments on commit 7b0ac9e

Please sign in to comment.