Opened 9 years ago
Last modified 9 years ago
#11904 closed defect
Configuration.parse_if_needed takes forever to reload if clock is going back — at Version 1
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.5 |
Component: | general | Version: | 0.12-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Configuration.parse_if_needed()
reload only when the file is modified by checking that its modified time is greater that saved modified time.
However, if system clock is going back (e.g. by ntpdate
), it would take forever to reload.
I think we should check difference between current and saved modified times.
-
trac/config.py
diff --git a/trac/config.py b/trac/config.py index 7b233d5..41932e6 100644
a b class Configuration(object): 267 267 268 268 changed = False 269 269 modtime = os.path.getmtime(self.filename) 270 if force or modtime >self._lastmtime:270 if force or modtime != self._lastmtime: 271 271 self._sections = {} 272 272 self.parser._sections = {} 273 273 if not self.parser.read(self.filename):
Note:
See TracTickets
for help on using tickets.