In my application, I'd like to run a service once a day that does some 
processing. It seems that lovely.remotetask can do that.

In my scenario, I have multiple sites, whereas each one should have such a 
cron job. What I do is the following:

In zope.conf:
<product-config lovely.remotetask>
                autostart [EMAIL PROTECTED]

And then, I created a subscriber for a INewSiteCreated event:

def cronLog():
    logger.debug("Log Entry!")

cronLogTask = SimpleTask(cronLog)
provideUtility(cronLogTask, name=u'cronLog')

def setupTasks(event):
    service = TaskService()
    sm = event.object.getSiteManager()
    sm['default']['testTaskService1'] = service
    sm.registerUtility(service, ITaskService, name='TestTaskService1')
    jobid = service.addCronJob(u'cronLog',
                               minute = tuple(range(60)))

Ok, the problem is, that the service is not running, which can be shown 
by "service.isProcessing()" -> False.

Thus I tried to add something like that at the end of the function:


But that results in a traceback:

line 158, in startProcessing
    thread = threading.Thread(
AttributeError: 'NoneType' object has no attribute 'db'

This "db" attribute refers to an object attribute "self._p_jar.db()" - no clue 
what that is or why it's None.

I also thought, that the directives in zope.conf would start my services on a 
zope restart, but that's not the case.

Hmmm, any clues how to start my services?

Best Regards,

GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to