[CalendarServer-changes] [10278] CalendarServer/branches/users/glyph/queue-locking-and-timing

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 4 16:39:48 PST 2013


Revision: 10278
          http://trac.calendarserver.org//changeset/10278
Author:   glyph at apple.com
Date:     2013-01-04 16:39:47 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
Correct the code enough that the test fails with failure.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/queue-locking-and-timing/

Modified: CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py
===================================================================
--- CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py	2013-01-05 00:39:46 UTC (rev 10277)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py	2013-01-05 00:39:47 UTC (rev 10278)
@@ -1208,19 +1208,20 @@
         """
         @inlineCallbacks
         def workCheck(txn):
-
-            nodes = [(node.hostname, node.port) for node in
-                     (yield self.activeNodes(txn))]
-            nodes.sort()
-            self._lastSeenTotalNodes = len(nodes)
-            self._lastSeenNodeIndex = nodes.index((self.thisProcess.hostname,
-                                                   self.thisProcess.port))
+            if self.thisProcess:
+                nodes = [(node.hostname, node.port) for node in
+                         (yield self.activeNodes(txn))]
+                nodes.sort()
+                self._lastSeenTotalNodes = len(nodes)
+                self._lastSeenNodeIndex = nodes.index(
+                    (self.thisProcess.hostname, self.thisProcess.port)
+                )
             for itemType in self.allWorkItemTypes():
                 for overdueItem in (
                         yield itemType.query(
                             txn,
                             (itemType.notBefore >
-                             datetime.datetime.utcfromtimestamp(
+                             datetime.utcfromtimestamp(
                                 self.reactor.seconds () +
                                 self.queueProcessTimeout
                             ))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/fc467e57/attachment-0001.html>


More information about the calendarserver-changes mailing list