Fixed only 'text' logs getting fsynced on write
(html & bbcode were only being writen on closing the memo window)
This commit is contained in:
parent
e3bdbf77f4
commit
0e1f676acc
1 changed files with 3 additions and 4 deletions
|
@ -79,12 +79,11 @@ class PesterLog(object):
|
|||
for (format, t) in modes.items():
|
||||
f = self.convos[handle][format]
|
||||
f.write(t+"\r\n")
|
||||
|
||||
# flush + fsync force a write, might not be required though.
|
||||
for (format, t) in modes.items():
|
||||
# flush + fsync force a write,
|
||||
# makes sure logs are saved in the case of a crash.
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
|
||||
|
||||
# This way the file descriptors are closed and reopened for every message,
|
||||
# which is sub-optimal and definitely a performance drain but,
|
||||
# otherwise we still run into the ulimit on platforms like MacOS fairly easily.
|
||||
|
|
Loading…
Reference in a new issue