Open the log file in shared mode

This commit is contained in:
Kovid Goyal 2015-06-16 19:25:36 +05:30
parent e200792884
commit 8f9229cab4

View File

@ -24,6 +24,7 @@ from calibre.utils.filenames import atomic_rename
from calibre.utils.localization import get_translator from calibre.utils.localization import get_translator
from calibre.utils.socket_inheritance import set_socket_inherit from calibre.utils.socket_inheritance import set_socket_inherit
from calibre.utils.logging import ThreadSafeLog from calibre.utils.logging import ThreadSafeLog
from calibre.utils.shared_file import share_open
HTTP1 = 'HTTP/1.0' HTTP1 = 'HTTP/1.0'
HTTP11 = 'HTTP/1.1' HTTP11 = 'HTTP/1.1'
@ -307,7 +308,7 @@ class RotatingStream(object):
self.set_output() self.set_output()
def set_output(self): def set_output(self):
self.stream = lopen(self.filename, 'ab', 1) # line buffered self.stream = share_open(self.filename, 'ab', 1) # line buffered
try: try:
self.current_pos = self.stream.tell() self.current_pos = self.stream.tell()
except EnvironmentError: except EnvironmentError: