Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua
erp5
Commits
3c2fbcb6
Commit
3c2fbcb6
authored
Jun 28, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
7f920b14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
33 deletions
+26
-33
product/ERP5Type/patches/WSGIPublisher.py
product/ERP5Type/patches/WSGIPublisher.py
+26
-33
No files found.
product/ERP5Type/patches/WSGIPublisher.py
View file @
3c2fbcb6
...
@@ -307,6 +307,10 @@ def transaction_pubevents(request, response, err_hook, tm=transaction.manager):
...
@@ -307,6 +307,10 @@ def transaction_pubevents(request, response, err_hook, tm=transaction.manager):
del
exc
,
exc_info
del
exc
,
exc_info
finally
:
finally
:
endInteraction
()
endInteraction
()
if
transaction
.
manager
.
_txn
is
not
None
:
# Only abort a transaction, if one exists. Otherwise the
# abort creates a new transaction just to abort it.
transaction
.
abort
()
def
publish
(
request
,
module_info
):
def
publish
(
request
,
module_info
):
...
@@ -347,22 +351,6 @@ def publish(request, module_info):
...
@@ -347,22 +351,6 @@ def publish(request, module_info):
return
response
return
response
@
contextmanager
def
load_app
(
module_info
):
app_wrapper
,
realm
,
debug_mode
=
module_info
# Loads the 'OFS.Application' from ZODB.
app
=
app_wrapper
()
try
:
yield
(
app
,
realm
,
debug_mode
)
finally
:
if
transaction
.
manager
.
_txn
is
not
None
:
# Only abort a transaction, if one exists. Otherwise the
# abort creates a new transaction just to abort it.
transaction
.
abort
()
app
.
_p_jar
.
close
()
def
publish_module
(
environ
,
start_response
,
def
publish_module
(
environ
,
start_response
,
_publish
=
publish
,
# only for testing
_publish
=
publish
,
# only for testing
_response
=
None
,
_response
=
None
,
...
@@ -400,14 +388,17 @@ def publish_module(environ, start_response,
...
@@ -400,14 +388,17 @@ def publish_module(environ, start_response,
environ
,
environ
,
new_response
))
new_response
))
app_wrapper
,
realm
,
debug_mode
=
module_info
app
=
app_wrapper
()
module_info
=
app
,
realm
,
debug_mode
try
:
for
i
in
range
(
getattr
(
new_request
,
'retry_max_count'
,
3
)
+
1
):
for
i
in
range
(
getattr
(
new_request
,
'retry_max_count'
,
3
)
+
1
):
request
=
new_request
request
=
new_request
response
=
new_response
response
=
new_response
setRequest
(
request
)
setRequest
(
request
)
try
:
try
:
with
load_app
(
module_info
)
as
new_mod_info
:
with
transaction_pubevents
(
request
,
response
,
err_hook
):
with
transaction_pubevents
(
request
,
response
,
err_hook
):
response
=
_publish
(
request
,
new_mod
_info
)
response
=
_publish
(
request
,
module
_info
)
break
break
except
TransientError
:
except
TransientError
:
if
request
.
supports_retry
():
if
request
.
supports_retry
():
...
@@ -418,6 +409,8 @@ def publish_module(environ, start_response,
...
@@ -418,6 +409,8 @@ def publish_module(environ, start_response,
finally
:
finally
:
request
.
close
()
request
.
close
()
clearRequest
()
clearRequest
()
finally
:
app
.
_p_jar
.
close
()
# Start the WSGI server response
# Start the WSGI server response
status
,
headers
=
response
.
finalize
()
status
,
headers
=
response
.
finalize
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment