mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
tweak max threads option handling
This commit is contained in:
parent
bfe3f18126
commit
de01700c54
@ -502,10 +502,7 @@ class PooledMixIn(socketserver.ThreadingMixIn):
|
|||||||
def __init__(self, max_threads=None):
|
def __init__(self, max_threads=None):
|
||||||
self.active_requests = set()
|
self.active_requests = set()
|
||||||
self.unaccepted_requests = 0
|
self.unaccepted_requests = 0
|
||||||
if max_threads:
|
self.max_threads = max_threads or 100
|
||||||
self.max_threads = max_threads
|
|
||||||
else:
|
|
||||||
self.max_threads = 100
|
|
||||||
self.pool = concurrent.futures.ThreadPoolExecutor(self.max_threads)
|
self.pool = concurrent.futures.ThreadPoolExecutor(self.max_threads)
|
||||||
self.logger.info("%s proxy threads", self.max_threads)
|
self.logger.info("%s proxy threads", self.max_threads)
|
||||||
|
|
||||||
@ -595,11 +592,6 @@ class PooledMitmProxy(PooledMixIn, MitmProxy):
|
|||||||
request_queue_size = 4096
|
request_queue_size = 4096
|
||||||
|
|
||||||
def __init__(self, options=warcprox.Options()):
|
def __init__(self, options=warcprox.Options()):
|
||||||
if options.max_threads:
|
|
||||||
self.logger.info(
|
|
||||||
'max_threads=%s set by command line option',
|
|
||||||
options.max_threads)
|
|
||||||
|
|
||||||
PooledMixIn.__init__(self, options.max_threads)
|
PooledMixIn.__init__(self, options.max_threads)
|
||||||
self.profilers = collections.defaultdict(cProfile.Profile)
|
self.profilers = collections.defaultdict(cProfile.Profile)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user