use a variable for the min number of jobs to collect

this variable determines after how many results the db is written to.
with a low value, it is written often and could more lock issues
if 2 threads concur for the db.
This commit is contained in:
rofl0r
2019-01-05 16:39:55 +00:00
parent f45cd1190c
commit 42f35855ea

View File

@@ -136,6 +136,7 @@ class Proxywatchd():
self.mysqlite.close()
self.mysqlite = None
self.submit_after = 200 # number of collected jobs before writing db
self.echoise = time.time() - 3600;
self.ticks = time.time() - 3600;
self.jobs = []
@@ -199,7 +200,7 @@ class Proxywatchd():
self.collect_work()
if len(self.collected) > 50:
if len(self.collected) > self.submit_after:
self.submit_collected()
time.sleep(1)