mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812) (GH-4466)
TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.
(cherry picked from commit afad147b59
)
This commit is contained in:
parent
80baec58f5
commit
65dffe58dd
1 changed files with 1 additions and 1 deletions
|
@ -356,10 +356,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
|||
suffix = fileName[plen:]
|
||||
if self.extMatch.match(suffix):
|
||||
result.append(os.path.join(dirName, fileName))
|
||||
result.sort()
|
||||
if len(result) < self.backupCount:
|
||||
result = []
|
||||
else:
|
||||
result.sort()
|
||||
result = result[:len(result) - self.backupCount]
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue