[Checkins] SVN: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/baseservice.py add missing method and fix threadName to ensure lovely.remotetask tests pass
Godefroid Chapelle
gotcha at bubblenet.be
Wed Apr 21 15:31:38 EDT 2010
Log message for revision 111227:
add missing method and fix threadName to ensure lovely.remotetask tests pass
better logging
Changed:
U Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/baseservice.py
-=-
Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/baseservice.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/baseservice.py 2010-04-21 19:29:50 UTC (rev 111226)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/baseservice.py 2010-04-21 19:31:38 UTC (rev 111227)
@@ -212,6 +212,11 @@
job.completed = datetime.datetime.now()
return True
+ def process(self, now=None):
+ """See interfaces.ITaskService"""
+ while self.processNext(now):
+ pass
+
def _pullJob(self, now=None):
# first move new cron jobs from the scheduled queue into the cronjob
# list
@@ -289,7 +294,7 @@
self._scheduledQueue = zc.queue.PersistentQueue()
# Create the path to the service within the DB.
servicePath = self.getServicePath()
- log.info('starting service %s' % self._threadName())
+ log.info('starting service %s' % self.__name__)
# Start the thread running the processor inside.
processor = self.processorFactory(
self._p_jar.db(), servicePath, **self.processorArguments)
@@ -323,12 +328,12 @@
def getServicePath(self):
raise NotImplemented
+ THREADNAME_PREFIX = 'taskqueue'
+
def _threadName(self):
"""Return name of the processing thread."""
# This name isn't unique based on the path to self, but this doesn't
# change the name that's been used in past versions.
path = self.getServicePath()
- path.append('remotetasks')
- path.reverse()
- path.append(self.__name__)
+ path.insert(0, self.THREADNAME_PREFIX)
return '.'.join(path)
More information about the checkins
mailing list