From dacbc8177a56fe9142f71f19c4da834ae7c9b0ed Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 5 Jan 2019 18:31:36 +0000 Subject: [PATCH] proxywatchd: fix memleak --- proxywatchd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxywatchd.py b/proxywatchd.py index 3970277..6d81897 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -216,9 +216,10 @@ class Proxywatchd(): if self.in_background: self._cleanup() break - if len(self.jobs) == 0: + if self.threads[random.choice(xrange(len(self.threads)))].jobcount() == 0: self.prepare_jobs() if len(self.jobs): + _log("watchd main: handing out %d jobs"%len(self.jobs)) jpt = len(self.jobs)/config.watchd_threads if len(self.jobs)/float(config.watchd_threads) - jpt > 0.0: jpt += 1 for tid in range(config.watchd_threads):