ne panique pas si le répertoire webcache ne peut être créé
This commit is contained in:
parent
9ec451cbef
commit
184e5b957b
|
@ -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))
|
||||
|
|
Reference in New Issue