mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220)
Fix support of interval values > 1 in logging.TimedRotatingFileHandler for when='MIDNIGHT' and when='Wx'.
This commit is contained in:
parent
20578a1f68
commit
269051d20e
3 changed files with 173 additions and 35 deletions
|
|
@ -340,7 +340,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
|||
daysToWait = self.dayOfWeek - day
|
||||
else:
|
||||
daysToWait = 6 - day + self.dayOfWeek + 1
|
||||
result += daysToWait * (60 * 60 * 24)
|
||||
result += daysToWait * _MIDNIGHT
|
||||
result += self.interval - _MIDNIGHT * 7
|
||||
else:
|
||||
result += self.interval - _MIDNIGHT
|
||||
if not self.utc:
|
||||
dstNow = t[-1]
|
||||
dstAtRollover = time.localtime(result)[-1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue