[CalendarServer-changes] [15758] twext/branches/users/cdaboo/better-next-job/twext/enterprise/jobs/ jobitem.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 12 19:15:49 PDT 2016


Revision: 15758
          http://trac.calendarserver.org//changeset/15758
Author:   cdaboo at apple.com
Date:     2016-07-12 19:15:49 -0700 (Tue, 12 Jul 2016)
Log Message:
-----------
Use new column in query so index is used.

Modified Paths:
--------------
    twext/branches/users/cdaboo/better-next-job/twext/enterprise/jobs/jobitem.py

Modified: twext/branches/users/cdaboo/better-next-job/twext/enterprise/jobs/jobitem.py
===================================================================
--- twext/branches/users/cdaboo/better-next-job/twext/enterprise/jobs/jobitem.py	2016-07-12 00:06:01 UTC (rev 15757)
+++ twext/branches/users/cdaboo/better-next-job/twext/enterprise/jobs/jobitem.py	2016-07-13 02:15:49 UTC (rev 15758)
@@ -400,7 +400,7 @@
                 job = yield cls.load(txn, jobID)
         else:
             # Only add the PRIORITY term if minimum is greater than zero
-            queryExpr = (cls.assigned == None).And(cls.pause == 0).And(cls.notBefore <= now)
+            queryExpr = (cls.isAssigned == 0).And(cls.pause == 0).And(cls.notBefore <= now)
 
             # PRIORITY can only be 0, 1, or 2. So we can convert an inequality into
             # an equality test as follows:
@@ -468,7 +468,7 @@
                 extra_kwargs["skipLocked"] = True
             jobs = yield cls.query(
                 txn,
-                (cls.assigned != None).And(cls.overdue < now),
+                (cls.isAssigned == 1).And(cls.overdue < now),
                 forUpdate=True,
                 noWait=False,
                 limit=rowLimit,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160712/3a8e66f8/attachment.html>


More information about the calendarserver-changes mailing list