From 8e4188652629c2e5c0501debb5f3ddee076b5a4e Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sun, 10 Oct 2021 23:38:31 +0800 Subject: Obtain problem info from JOJ frontend At the cost of multiprocessing. We will bring it back... some day. --- worker/JOJWorker.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'worker/JOJWorker.py') diff --git a/worker/JOJWorker.py b/worker/JOJWorker.py index df761f8..4e17956 100644 --- a/worker/JOJWorker.py +++ b/worker/JOJWorker.py @@ -106,11 +106,16 @@ class JOJWorker(): res = {} hwNum = self.args.hw for key, value in self.hgroups.items(): - with multiprocessing.Pool(len(jojInfo["problemInfo"])) as p: - scores = p.starmap( - self.checkGroupJOJProcess, - [[HGROUP_NO, hwNum, jojInfo, fns, problemID] - for fns, problemID, _ in jojInfo["problemInfo"]]) + # TODO: re-enable multiprocessing + # with multiprocessing.Pool(len(jojInfo["problemInfo"])) as p: + # scores = p.starmap( + # self.checkGroupJOJProcess, + # [[HGROUP_NO, hwNum, jojInfo, fns, problemID] + # for fns, problemID, _ in jojInfo["problemInfo"]]) + scores = [ + self.checkGroupJOJProcess(HGROUP_NO, hwNum, jojInfo, fns, problemID) + for fns, problemID, _ in jojInfo["problemInfo"] + ] scores = [(scores[i], jojInfo["problemInfo"][i][2]) for i in range(len(scores))] self.logger.info(f"{key} h{hwNum} score {scores.__repr__()}") -- cgit v1.2.3