ne panique pas si le répertoire webcache ne peut être créé

This commit is contained in:
fpeters 2004-04-17 20:23:02 +00:00
parent 9ec451cbef
commit 184e5b957b
1 changed files with 9 additions and 4 deletions

View File

@ -591,11 +591,12 @@ class Application(applications.Application):
# Handle web cache.
reqCache = None
if sessionToken is None:
reqCache = RequestCache(req, languages[0])
try:
reqCache = RequestCache(req, languages[0])
except OSError:
reqCache = None
reqCache.cacheTime = context.getVar('cacheTime')
if not virtualHost.cacheFiles:
reqCache.caching = -1
modTime = reqCache.checkDepends()
reqCache = None
else:
req.headers_out['Expires'] = reqCache.getExpires()
@ -1318,7 +1319,11 @@ class RequestCache:
context.getVar('varDirectoryPath'), 'webcache',
context.getVar('virtualHost').hostName)
if not os.path.exists(self.cacheDirectoryPath):
os.mkdir(self.cacheDirectoryPath)
try:
os.mkdir(self.cacheDirectoryPath)
except OSError:
return
self.cacheFilePath = os.path.join(
self.cacheDirectoryPath,
self.getCacheFileName(language))