mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #18941: Respected delay when doing rollover.
This commit is contained in:
parent
d859926b29
commit
43c6ef1899
2 changed files with 7 additions and 4 deletions
|
@ -174,7 +174,8 @@ class RotatingFileHandler(BaseRotatingHandler):
|
|||
if os.path.exists(dfn):
|
||||
os.remove(dfn)
|
||||
self.rotate(self.baseFilename, dfn)
|
||||
self.stream = self._open()
|
||||
if not self.delay:
|
||||
self.stream = self._open()
|
||||
|
||||
def shouldRollover(self, record):
|
||||
"""
|
||||
|
@ -382,7 +383,8 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
|||
if self.backupCount > 0:
|
||||
for s in self.getFilesToDelete():
|
||||
os.remove(s)
|
||||
self.stream = self._open()
|
||||
if not self.delay:
|
||||
self.stream = self._open()
|
||||
newRolloverAt = self.computeRollover(currentTime)
|
||||
while newRolloverAt <= currentTime:
|
||||
newRolloverAt = newRolloverAt + self.interval
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue