From 1cafce67f079477c9467c42811f1daf04f573778 Mon Sep 17 00:00:00 2001 From: mickael Date: Sat, 5 Jan 2019 23:55:40 +0000 Subject: [PATCH] no need to store 'duration' value in db --- proxywatchd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxywatchd.py b/proxywatchd.py index 58af372..addfab1 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -155,7 +155,7 @@ class Proxywatchd(): # create table if needed self._prep_db() - self.mysqlite.execute('CREATE TABLE IF NOT EXISTS proxylist (proxy BLOB, country BLOB, added INT, failed INT, tested INT, source BLOB, dronebl INT, proto TEXT, duration INT, success_count INT, total_duration INT)') + self.mysqlite.execute('CREATE TABLE IF NOT EXISTS proxylist (proxy BLOB, country BLOB, added INT, failed INT, tested INT, source BLOB, dronebl INT, proto TEXT, success_count INT, total_duration INT)') self.mysqlite.commit() self._close_db() @@ -179,8 +179,8 @@ class Proxywatchd(): 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=?,success_count=?,total_duration=? WHERE proxy=?' - args = [ (job.failcount, job.nextcheck, 1, 'unknown', job.proto, job.success_count, job.total_duration, job.duration, job.proxy) for job in self.collected ] + query = 'UPDATE proxylist SET failed=?,tested=?,dronebl=?,country=?,proto=?,success_count=?,total_duration=? WHERE proxy=?' + args = [ (job.failcount, job.nextcheck, 1, 'unknown', job.proto, job.success_count, job.total_duration, job.proxy) for job in self.collected ] self.mysqlite.executemany(query, args) self.mysqlite.commit() self._close_db()