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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user