Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f6ae33b4
Commit
f6ae33b4
authored
May 01, 2006
by
Lennart Regebro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Neater shutdown with twisted.
parent
286a3dae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
lib/python/Lifetime/__init__.py
lib/python/Lifetime/__init__.py
+5
-0
lib/python/ZServer/HTTPResponse.py
lib/python/ZServer/HTTPResponse.py
+1
-0
lib/python/ZServer/PubCore/ZServerPublisher.py
lib/python/ZServer/PubCore/ZServerPublisher.py
+1
-0
lib/python/Zope2/Startup/__init__.py
lib/python/Zope2/Startup/__init__.py
+4
-1
No files found.
lib/python/Lifetime/__init__.py
View file @
f6ae33b4
...
...
@@ -31,6 +31,11 @@ def shutdown(exit_code,fast = 0):
import
ZServer
ZServer
.
exit_code
=
exit_code
_shutdown_phase
=
1
try
:
from
twisted.internet
import
reactor
reactor
.
callLater
(
0.1
,
reactor
.
stop
)
except
ImportError
:
pass
if
fast
:
# Someone wants us to shutdown fast. This is hooked into SIGTERM - so
# possibly the system is going down and we can expect a SIGKILL within
...
...
lib/python/ZServer/HTTPResponse.py
View file @
f6ae33b4
...
...
@@ -313,6 +313,7 @@ class ChannelPipe:
def
start_response
(
self
,
status
,
headers
,
exc_info
=
None
):
# Used for WSGI
self
.
_request
.
reply_code
=
int
(
status
.
split
(
' '
)[
0
])
status
=
'HTTP/%s %s
\
r
\
n
'
%
(
self
.
_request
.
version
,
status
)
self
.
write
(
status
)
headers
=
'
\
r
\
n
'
.
join
([
': '
.
join
(
x
)
for
x
in
headers
])
...
...
lib/python/ZServer/PubCore/ZServerPublisher.py
View file @
f6ae33b4
...
...
@@ -33,5 +33,6 @@ class ZServerPublisher:
for
r
in
res
:
a
[
'wsgi.output'
].
write
(
r
)
finally
:
# TODO: Support keeping connections open.
a
[
'wsgi.output'
].
_close
=
1
a
[
'wsgi.output'
].
close
()
lib/python/Zope2/Startup/__init__.py
View file @
f6ae33b4
...
...
@@ -115,12 +115,15 @@ class ZopeStarter:
try
:
from
App.config
import
getConfiguration
config
=
getConfiguration
()
import
ZServer
if
config
.
twisted_servers
:
if
not
_use_twisted
:
raise
ImportError
(
"You do not have twisted installed."
)
twisted
.
internet
.
reactor
.
run
()
# Storing the exit code in the ZServer even for twisted,
# but hey, it works...
sys
.
exit
(
ZServer
.
exit_code
)
else
:
import
ZServer
import
Lifetime
Lifetime
.
loop
()
sys
.
exit
(
ZServer
.
exit_code
)
...
...
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