make "submit_after" a configuratble option (config.ini)
This commit is contained in:
@@ -7,6 +7,7 @@ proxy_max_fail = 5
|
|||||||
proxy_file = false
|
proxy_file = false
|
||||||
threads = 10
|
threads = 10
|
||||||
timeout = 15
|
timeout = 15
|
||||||
|
submit_after = 200
|
||||||
|
|
||||||
[proxyfind]
|
[proxyfind]
|
||||||
search = true
|
search = true
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ _loaded = False
|
|||||||
|
|
||||||
def load():
|
def load():
|
||||||
if _loaded: return
|
if _loaded: return
|
||||||
global database, maxfail, search, torhosts, watchd_threads, checktime, timeout, read_timeout
|
global database, maxfail, search, torhosts, watchd_threads, checktime, timeout, read_timeout, submit_after
|
||||||
|
|
||||||
## read the config files
|
## read the config files
|
||||||
parser = SafeConfigParser()
|
parser = SafeConfigParser()
|
||||||
@@ -18,6 +18,7 @@ def load():
|
|||||||
torhosts = [ str(i).strip() for i in parser.get('global', 'tor_host').split(',') ]
|
torhosts = [ str(i).strip() for i in parser.get('global', 'tor_host').split(',') ]
|
||||||
watchd_threads = parser.getint('watcherd', 'threads')
|
watchd_threads = parser.getint('watcherd', 'threads')
|
||||||
timeout = parser.getint('watcherd', 'timeout')
|
timeout = parser.getint('watcherd', 'timeout')
|
||||||
|
submit_after = parser.getint('watcherd', 'submit_after')
|
||||||
|
|
||||||
# allow overriding select items from the commandline
|
# allow overriding select items from the commandline
|
||||||
import argparse
|
import argparse
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ class Proxywatchd():
|
|||||||
self.mysqlite = None
|
self.mysqlite = None
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
config.load()
|
config.load()
|
||||||
|
global submit_after
|
||||||
self.in_background = False
|
self.in_background = False
|
||||||
self.threads = []
|
self.threads = []
|
||||||
self.stopping = threading.Event()
|
self.stopping = threading.Event()
|
||||||
@@ -159,7 +160,7 @@ class Proxywatchd():
|
|||||||
self.mysqlite.commit()
|
self.mysqlite.commit()
|
||||||
self._close_db()
|
self._close_db()
|
||||||
|
|
||||||
self.submit_after = 200 # number of collected jobs before writing db
|
self.submit_after = config.submit_after # number of collected jobs before writing db
|
||||||
self.jobs = []
|
self.jobs = []
|
||||||
self.collected = []
|
self.collected = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user