mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Optimize sub process startup with workers
This commit is contained in:
parent
503b09c984
commit
92e9764f58
@ -885,7 +885,7 @@ def get_process():
|
||||
except IndexError:
|
||||
filepath = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'processor.py'
|
||||
cmd = [sys.executable, '-c', readf(filepath)]
|
||||
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0)
|
||||
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0, close_fds=True)
|
||||
|
||||
def run_prefork_process(cmd, kwargs, cargs):
|
||||
"""
|
||||
|
@ -27,6 +27,10 @@ def run():
|
||||
[cmd, kwargs, cargs] = cPickle.loads(base64.b64decode(txt))
|
||||
cargs = cargs or {}
|
||||
|
||||
if not 'close_fds' in kwargs:
|
||||
# workers have no fds
|
||||
kwargs['close_fds'] = False
|
||||
|
||||
ret = 1
|
||||
out, err, ex, trace = (None, None, None, None)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user