[Bugfix] operation on closed file. (#2438)

pull/2511/head
jokimina 2019-02-26 12:42:34 +08:00 committed by 老广
parent 69f640daa4
commit adf8b1f7aa
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class CeleryTaskFileHandler(CeleryTaskLoggerHandler):
def emit(self, record):
msg = self.format(record)
if not self.f:
if not self.f or self.f.closed:
return
self.f.write(msg)
self.f.write(self.terminator)