Rev1930, Change stack size argument for special hardwares
This commit is contained in:
parent
221aa16433
commit
a59cf9b9aa
2 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.5.2"
|
self.version = "0.5.2"
|
||||||
self.rev = 1929
|
self.rev = 1930
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.config_file = "zeronet.conf"
|
self.config_file = "zeronet.conf"
|
||||||
|
@ -202,6 +202,7 @@ class Config(object):
|
||||||
self.parser.add_argument('--keep_ssl_cert', help='Disable new SSL cert generation on startup', action='store_true')
|
self.parser.add_argument('--keep_ssl_cert', help='Disable new SSL cert generation on startup', action='store_true')
|
||||||
self.parser.add_argument('--max_files_opened', help='Change maximum opened files allowed by OS to this value on startup',
|
self.parser.add_argument('--max_files_opened', help='Change maximum opened files allowed by OS to this value on startup',
|
||||||
default=2048, type=int, metavar='limit')
|
default=2048, type=int, metavar='limit')
|
||||||
|
self.parser.add_argument('--stack_size', help='Change thread stack size', default=None, type=int, metavar='thread_stack_size')
|
||||||
self.parser.add_argument('--use_tempfiles', help='Use temporary files when downloading (experimental)',
|
self.parser.add_argument('--use_tempfiles', help='Use temporary files when downloading (experimental)',
|
||||||
type='bool', choices=[True, False], default=False)
|
type='bool', choices=[True, False], default=False)
|
||||||
self.parser.add_argument('--stream_downloads', help='Stream download directly to files (experimental)',
|
self.parser.add_argument('--stream_downloads', help='Stream download directly to files (experimental)',
|
||||||
|
|
|
@ -107,6 +107,11 @@ config.parse() # Parse again to add plugin configuration options
|
||||||
# Log current config
|
# Log current config
|
||||||
logging.debug("Config: %s" % config)
|
logging.debug("Config: %s" % config)
|
||||||
|
|
||||||
|
# Modify stack size on special hardwares
|
||||||
|
if config.stack_size:
|
||||||
|
import threading
|
||||||
|
threading.stack_size(config.stack_size)
|
||||||
|
|
||||||
# Use pure-python implementation of msgpack to save CPU
|
# Use pure-python implementation of msgpack to save CPU
|
||||||
if config.msgpack_purepython:
|
if config.msgpack_purepython:
|
||||||
os.environ["MSGPACK_PUREPYTHON"] = "True"
|
os.environ["MSGPACK_PUREPYTHON"] = "True"
|
||||||
|
|
Loading…
Reference in a new issue