Ticket #3833: env_reload_5342.diff
| File env_reload_5342.diff, 2.0 KB (added by osimons <simon-code@…>, 21 months ago) |
|---|
-
Users/simon/dev/svn_out/trac-0.10-stable/trac/config.py
173 173 finally: 174 174 fileobj.close() 175 175 176 def parse_if_needed(self ):176 def parse_if_needed(self, check_only=False): 177 177 # Load global configuration 178 # Alternatively, if check_only it returns True if it needs updating 178 179 if os.path.isfile(self.site_filename): 179 180 modtime = os.path.getmtime(self.site_filename) 180 181 if modtime > self._lastsitemtime: 182 if check_only: 183 return True 181 184 self.site_parser.read(self.site_filename) 182 185 self._lastsitemtime = modtime 183 186 … … 185 188 return 186 189 modtime = os.path.getmtime(self.filename) 187 190 if modtime > self._lastmtime: 191 if check_only: 192 return True 188 193 self.parser.read(self.filename) 189 194 self._lastmtime = modtime 190 195 -
Users/simon/dev/svn_out/trac-0.10-stable/trac/web/main.py
54 54 env = None 55 55 env_cache_lock.acquire() 56 56 try: 57 if not env_path in env_cache: 57 if (not env_path in env_cache) or ( 58 env_cache[env_path].config.parse_if_needed(check_only=True)): 58 59 env_cache[env_path] = open_environment(env_path) 59 60 env = env_cache[env_path] 60 61 finally: 61 62 env_cache_lock.release() 62 63 63 # Re-parse the configuration file if it changed since the last the time it64 # was parsed65 env.config.parse_if_needed()66 67 64 return env 68 65 69 66 def populate_hdf(hdf, env, req=None):
