[Zope3-Users] Re: lovely.remotetask question

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Wed Apr 4 01:35:32 EDT 2007


> For startup do this :
>
> @component.adapter(IDatabaseOpenedEvent)
> def startRemoteTask(event):
>     """Start the amazon remotetask on startup."""
>     db = event.database
>     connection = db.open()
>     root = connection.root()
>     root_folder = root.get(ZopePublication.root_name, None)
>     for site in root_folder.values():
>         service = component.queryUtility(
>             ITaskService, context=site)
>         if service is not None:
>             if not service.isProcessing():
>                 service.startProcessing()
>
> I assume here that the remote tasks are located in one of the site
> directly contained in root.
Works for me now :)
>
>
> For shutdown :
>
> I have no solution for this right now.
So seems that now it is best to manually click on stop processing button
via
ZMI before shutting Zope down.

Thanks!

-- 
Maciej Wisniowski


More information about the Zope3-users mailing list