Commit 3ce7a5ee authored by Chris Harris's avatar Chris Harris
Browse files

vtkWeb: Use unbuffered file read/write for stdout

Use unbuffered reads/writes when accessing the stdout file for
Python processes started by launcher. This ensures that the
"ready line" will appear in the file as soon as the process writes
it.

Change-Id: I58286236b9d5bbe781cc969a0e432ccdd091d47a
parent 56812f02
......@@ -291,7 +291,7 @@ class ProcessManager(object):
# Create output log file
logFilePath = self._getLogFilePath(session['id'])
with open(logFilePath, "a+") as log_file:
with open(logFilePath, "a+", 0) as log_file:
try:
proc = subprocess.Popen(session['cmd'], stdout=log_file, stderr=log_file)
self.processes[session['id']] = proc
......@@ -349,7 +349,7 @@ class ProcessManager(object):
# Check the output for ready_line
logFilePath = self._getLogFilePath(session['id'])
with open(logFilePath, "r") as log_file:
with open(logFilePath, "r", 0) as log_file:
for line in log_file.readlines():
if ready_line in line:
ready = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment