Merge branch 'changes3' into 'master'

proxywatchd: improve logging

See merge request mserneels/ppf!3
This commit is contained in:
mserneels
2019-01-05 22:55:04 +00:00

View File

@@ -117,7 +117,7 @@ class WorkerThread():
if self.done.is_set(): break
time.sleep(0.01)
if self.thread:
_log("thread %s terminated", self.id)
_log("thread terminated", self.id)
class Proxywatchd():
@@ -177,6 +177,7 @@ class Proxywatchd():
self.collected.extend(wt.collect())
def submit_collected(self):
_log("watchd main thread: updating %d entries"%len(self.collected))
self._prep_db()
query = 'UPDATE proxylist SET failed=?,tested=?,dronebl=?,country=?,proto=?,duration=? WHERE proxy=?'
args = [ (job.failcount, job.nextcheck, 1, 'unknown', job.proto, job.duration, job.proxy) for job in self.collected ]