Skip to content

Commit

Permalink
Add ZODBMountPoint temp_folder if available (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeier76 authored Oct 6, 2023
1 parent 75bcf28 commit 98b7cd7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Products/zms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,15 @@ def create_session_storage_if_neccessary(context):

app = context.getApplication()
if not 'temp_folder' in app:
# Adding a 'folder' is a just fallback
# if a 'mount_point' is not available
# like usually configured via zope.conf
temp_folder = Folder('temp_folder')
app._setObject('temp_folder', temp_folder)
try:
from Products.ZODBMountPoint.MountedObject import manage_addMounts
manage_addMounts(app, paths=('/temp_folder',))
except:
# Adding a 'folder' is a just fallback
# if a 'mount_point' is not available
# like usually configured via zope.conf
temp_folder = Folder('temp_folder')
app._setObject('temp_folder', temp_folder)
if not 'session_data' in app.temp_folder:
container = TransientObjectContainer(
'session_data',
Expand Down

0 comments on commit 98b7cd7

Please sign in to comment.