Changeset 306ce5 in indico
- Timestamp:
- 11/09/11 09:11:39 (19 months ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 8362d6
- Parents:
- cebb45b
- Location:
- indico
- Files:
-
- 2 edited
-
MaKaC/common/cache.py (modified) (3 diffs)
-
modules/upcoming.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/common/cache.py
r2cbbaf r306ce5 146 146 raise NotImplementedError 147 147 148 148 149 @CacheStorage.register(True) 149 150 class FileCacheStorage(CacheStorage): … … 163 164 f = open(filePath, 'wb') 164 165 OSSpecific.lockFile(f, 'LOCK_EX') 165 pickle.dump(data, f) 166 OSSpecific.lockFile(f, 'LOCK_UN') 167 f.close() 166 try: 167 pickle.dump(data, f) 168 finally: 169 OSSpecific.lockFile(f, 'LOCK_UN') 170 f.close() 168 171 169 172 def load(self, path, name, default=None): … … 173 176 f = open(filePath, 'rb') 174 177 OSSpecific.lockFile(f, 'LOCK_SH') 175 obj = pickle.load(f) 176 mtime = os.path.getmtime(filePath) 177 OSSpecific.lockFile(f, 'LOCK_UN') 178 f.close() 178 try: 179 obj = pickle.load(f) 180 mtime = os.path.getmtime(filePath) 181 finally: 182 OSSpecific.lockFile(f, 'LOCK_UN') 183 f.close() 179 184 return obj, mtime 180 185 -
indico/modules/upcoming.py
r2cbbaf r306ce5 205 205 def getUpcomingEventList(self): 206 206 207 # check if there's a valid cached copy first 208 fromCache = self._cache.loadObject() 207 try: 208 # check if there's a valid cached copy first 209 fromCache = self._cache.loadObject() 210 except: 211 Logger.get('upcoming_events').exception("Upcoming events cache error") 212 fromCache = None 209 213 210 214 if fromCache:
Note: See TracChangeset
for help on using the changeset viewer.
