[CalendarServer-changes] [14020] twext/trunk/twext/enterprise/jobqueue.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 30 01:02:58 PDT 2014


Revision: 14020
          http://trac.calendarserver.org//changeset/14020
Author:   cdaboo at apple.com
Date:     2014-09-30 01:02:58 -0700 (Tue, 30 Sep 2014)
Log Message:
-----------
Fix for control api waits.

Modified Paths:
--------------
    twext/trunk/twext/enterprise/jobqueue.py

Modified: twext/trunk/twext/enterprise/jobqueue.py
===================================================================
--- twext/trunk/twext/enterprise/jobqueue.py	2014-09-29 23:31:24 UTC (rev 14019)
+++ twext/trunk/twext/enterprise/jobqueue.py	2014-09-30 08:02:58 UTC (rev 14020)
@@ -755,13 +755,16 @@
         """
         t = time.time()
         while True:
-            count = 0
+            count = [0]
+
+            @inlineCallbacks
             def _countTypes(txn):
                 for t in workTypes:
-                    work = yield t.all()
-                    count += len(work)
+                    work = yield t.all(txn)
+                    count[0] += len(work)
+
             yield inTransaction(txnCreator, _countTypes)
-            if count == 0:
+            if count[0] == 0:
                 break
             if time.time() - t > timeout:
                 returnValue(False)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140930/5447e096/attachment.html>


More information about the calendarserver-changes mailing list