Separate config argument for workers

This commit is contained in:
shortcutme 2017-02-27 00:02:56 +01:00
parent bad2a79f05
commit fe7a53fb8a
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 3 additions and 2 deletions

View file

@ -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')

View file

@ -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):