[Zope-Checkins] CVS: Zope/lib/python/App - ApplicationManager.py:1.82
Toby Dickenson
tdickenson@geminidataloggers.com
Mon, 4 Nov 2002 08:33:48 -0500
Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv11475/lib/python/App
Modified Files:
ApplicationManager.py
Log Message:
clean shutdown
=== Zope/lib/python/App/ApplicationManager.py 1.81 => 1.82 ===
--- Zope/lib/python/App/ApplicationManager.py:1.81 Wed Aug 14 17:31:40 2002
+++ Zope/lib/python/App/ApplicationManager.py Mon Nov 4 08:33:47 2002
@@ -28,6 +28,7 @@
from cStringIO import StringIO
from AccessControl import getSecurityManager
import zLOG
+import Lifetime
try: import thread
except: get_ident=lambda: 0
@@ -326,12 +327,12 @@
zLOG.LOG("ApplicationManager", zLOG.INFO,
"Restart requested by %s" % user)
for db in Globals.opened: db.close()
- raise SystemExit, """<html>
+ Lifetime.shutdown(1)
+ return """<html>
<head><meta HTTP-EQUIV=REFRESH CONTENT="5; URL=%s/manage_main">
</head>
<body>Zope is restarting</body></html>
""" % URL1
- sys.exit(1)
def manage_shutdown(self):
"""Shut down the application"""
@@ -341,8 +342,13 @@
user = 'unknown user'
zLOG.LOG("ApplicationManager", zLOG.INFO,
"Shutdown requested by %s" % user)
- for db in Globals.opened: db.close()
- sys.exit(0)
+ #for db in Globals.opened: db.close()
+ Lifetime.shutdown(0)
+ return """<html>
+ <head>
+ </head>
+ <body>Zope is shutting down</body></html>
+ """
def manage_pack(self, days=0, REQUEST=None):
"""Pack the database"""