This commit is contained in:
Your Name
2021-05-12 08:06:03 +02:00
parent 29675be5a2
commit d3d83e1d90
6 changed files with 237 additions and 138 deletions

View File

@@ -129,8 +129,8 @@ class WorkerJob():
self.failcount += failinc
return
try:
#recv = sock.recv(6)
recv = sock.recvline()
recv = sock.recv(6)
#recv = sock.recvline()
# good data
if re.match('^(:|NOTICE|ERROR)', recv, re.IGNORECASE):
@@ -149,7 +149,6 @@ class WorkerJob():
recvstats = "".join([x if x in string.printable and ord(x) > 32 else '.' for x in recv])
_log('%s://%s (%s) d: %.2f sec(s);%s srv: %s; recv: %s' % (proto, self.proxy, self.country, duration, torstats, srv, recvstats), 'xxxxx')
else:
print('bad data: %s' %recv.strip())
self.failcount += 1
except KeyboardInterrupt as e:
raise e
@@ -384,7 +383,6 @@ class Proxywatchd():
if self.threads[random.choice(xrange(len(self.threads)))].jobcount() == 0:
self.collect_unfinished()
if not len(self.jobs):
print('jobs are done ?')
self.collect_work()
if not self.submit_collected() and self.tor_safeguard:
_log("zzZzZzzZ sleeping 1 minute(s) due to tor issues - consider decreasing thread number!", "watchd")
@@ -396,6 +394,7 @@ class Proxywatchd():
if len(self.jobs) < len(self.threads):
# allow threads enough time to consume the jobs
sleeptime = 10
#if len(self.jobs) >= len(self.threads):
if len(self.jobs):
_log("handing out %d jobs to %d thread(s)"% (len(self.jobs), len(self.threads)), 'watchd')
jpt = len(self.jobs)/len(self.threads)