diff options
author | Frederick Yin <fred.yin@sjtu.edu.cn> | 2021-10-10 23:38:31 +0800 |
---|---|---|
committer | Frederick Yin <fred.yin@sjtu.edu.cn> | 2021-10-10 23:38:31 +0800 |
commit | 8e4188652629c2e5c0501debb5f3ddee076b5a4e (patch) | |
tree | b5e12dc672a4046b08a8b60d40a1308a3e2ede7d /worker | |
parent | bc60b6138fe9e8987d491ecd82f87987e0d0069b (diff) |
Obtain problem info from JOJ frontend
At the cost of multiprocessing. We will bring it back... some day.
Diffstat (limited to 'worker')
-rw-r--r-- | worker/JOJWorker.py | 15 |
1 files changed, 10 insertions, 5 deletions
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__()}") |