Skip to content

Commit

Permalink
Move _requestShutdown logic into ZServer.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Aug 13, 2016
1 parent 5a54bdf commit ae2c1d3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/ZPublisher/HTTPResponse.py
Expand Up @@ -556,20 +556,15 @@ def redirect(self, location, status=302, lock=0):

return str(location)

# The following two methods are part of a private protocol with the
# publisher for handling fatal import errors and TTW shutdown requests.
# The following two methods are part of a private protocol with
# ZServer for handling fatal import errors.
_shutdown_flag = None

def _requestShutdown(self, exitCode=0):
""" Request that the server shut down with exitCode after fulfilling
the current request.
"""
self._shutdown_flag = 1
try:
from ZServer.Zope2.Startup import config
config.ZSERVER_EXIT_CODE = exitCode
except ImportError:
pass
self._shutdown_flag = exitCode

def _shutdownRequested(self):
""" Returns true if this request requested a server shutdown.
Expand Down

0 comments on commit ae2c1d3

Please sign in to comment.