changes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user