no need to store 'duration' value in db

This commit is contained in:
mickael
2019-01-05 23:55:40 +00:00
parent 67cf6a18ea
commit 1cafce67f0

View File

@@ -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()