[Zope3-Users] server shutdown event

Shailesh Kumar shaileshk at gmail.com
Fri Dec 1 07:04:20 EST 2006


Hi,

I wanted to do some cleanup activities during the time of server shutdown.
Couldn't find any particular event that is sent at that time. But looking
at: zope.app.main.main, i tried:

from twisted.internet import reactor

def shutdown():
  #shutdown code here.
   pass

reactor.addSystemEventTrigger('before',
            'shutdown', shutdown)

and this seems to work. (did this under an event handler for
DatabaseOpenedWithRootEvent).

Just want to confirm, is it the right way to do, or there is some better way
to do things?

With regards,
-Shailesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20061201/e3beabc5/attachment.htm


More information about the Zope3-users mailing list