From e94bdf46425f09c55ac7a794f8fdb7044adb312b Mon Sep 17 00:00:00 2001 From: Biryuzovye Kleshni Date: Sun, 15 Jul 2018 20:03:29 +0000 Subject: [PATCH] Fix "maxcores" setting --- src/singleworker.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/singleworker.py b/src/singleworker.py index 9a061cec..80f070e0 100644 --- a/src/singleworker.py +++ b/src/singleworker.py @@ -244,9 +244,11 @@ class singleWorker(threading.Thread, helper_threading.StoppableThread): parallelism = bmconfigparser.BMConfigParser().safeGetInt("bitmessagesettings", "maxcores") - if parallelism is None: + if parallelism < 1: parallelism = self.workProver.defaultParallelism + debug.logger.info("Availabe solvers: %s", str(self.workProver.availableSolvers.keys())) + if "gpu" in self.workProver.availableSolvers and GPUVendor is not None: self.workProver.commandsQueue.put(("setSolver", "gpu", None)) elif "fast" in self.workProver.availableSolvers: @@ -768,10 +770,10 @@ class singleWorker(threading.Thread, helper_threading.StoppableThread): if ackMessage is None: newStatus = "msgsentnoackexpected" + sleepTill = 0 else: newStatus = "msgsent" - - sleepTill = int(time.time() + TTL * 1.1) + sleepTill = int(time.time() + TTL * 1.1) helper_sql.sqlExecute(""" UPDATE "sent" SET "msgid" = ?, "status" = ?, "retrynumber" = ?,