mirror of
https://github.com/HelloZeroNet/ZeroNet.git
synced 2023-12-14 04:33:03 +01:00
Separate config argument for workers
This commit is contained in:
parent
bad2a79f05
commit
fe7a53fb8a
2 changed files with 3 additions and 2 deletions
|
@ -183,6 +183,7 @@ class Config(object):
|
|||
metavar='address')
|
||||
self.parser.add_argument('--size_limit', help='Default site size limit in MB', default=10, type=int, metavar='size')
|
||||
self.parser.add_argument('--connected_limit', help='Max connected peer per site', default=6, type=int, metavar='connected_limit')
|
||||
self.parser.add_argument('--workers', help='Download workers per site', default=5, type=int, metavar='workers')
|
||||
|
||||
self.parser.add_argument('--fileserver_ip', help='FileServer bind address', default="*", metavar='ip')
|
||||
self.parser.add_argument('--fileserver_port', help='FileServer bind port', default=15441, type=int, metavar='port')
|
||||
|
|
|
@ -126,9 +126,9 @@ class WorkerManager(object):
|
|||
|
||||
def getMaxWorkers(self):
|
||||
if len(self.tasks) > 100:
|
||||
return config.connected_limit * 3
|
||||
return config.workers * 3
|
||||
else:
|
||||
return config.connected_limit
|
||||
return config.workers
|
||||
|
||||
# Add new worker
|
||||
def addWorker(self, peer):
|
||||
|
|
Loading…
Reference in a new issue