You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-08-10 22:31:47 +02:00
Flush buffer on flush() and flush explicitely after subprocess has ended
(cherry picked from commit f16467b984
)
This commit is contained in:
@@ -50,10 +50,11 @@ class LogFilter(object):
|
|||||||
self.stream.flush()
|
self.stream.flush()
|
||||||
self.buffer = rest
|
self.buffer = rest
|
||||||
|
|
||||||
def close(self):
|
def flush(self):
|
||||||
|
# write out buffer on flush even if it's not a complete line
|
||||||
if self.buffer and not self.pattern.search(self.buffer):
|
if self.buffer and not self.pattern.search(self.buffer):
|
||||||
self.stream.buffer.write(self.buffer)
|
self.stream.buffer.write(self.buffer)
|
||||||
self.stream.close()
|
self.stream.flush()
|
||||||
|
|
||||||
def _is_compatible_with_hardened_malloc():
|
def _is_compatible_with_hardened_malloc():
|
||||||
with open('/proc/cpuinfo', 'r') as f:
|
with open('/proc/cpuinfo', 'r') as f:
|
||||||
@@ -168,4 +169,7 @@ def run_process_and_forward_output(cmd):
|
|||||||
stderr_thread.daemon = True
|
stderr_thread.daemon = True
|
||||||
stderr_thread.start()
|
stderr_thread.start()
|
||||||
|
|
||||||
return process.wait()
|
rc = process.wait()
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stderr.flush()
|
||||||
|
return rc
|
||||||
|
Reference in New Issue
Block a user