Commit 611792fa authored by Aurel's avatar Aurel

implement a minimal shutdown callback, it must be extended in the

future in order to close properly everything wihtout letting any
transaction not commited


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@634 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 414cdf5a
......@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import logging
import os
import os, sys
from time import time, gmtime
from struct import pack, unpack
......@@ -797,3 +797,11 @@ class Application(object):
return uuid != self.uuid and uuid != INVALID_UUID
def shutdown(self):
"""Close all connections and exit"""
self.em.poll(1)
for c in self.em.getConnectionList():
if not c.isListeningConnection():
c.close()
sys.exit("Application has been asked to shut down")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment