[CalendarServer-changes] [14774] CalendarServer/trunk/calendarserver/push/notifier.py
source_changes at macosforge.org
source_changes at macosforge.org
Sun May 10 08:40:44 PDT 2015
Revision: 14774
http://trac.calendarserver.org//changeset/14774
Author: cdaboo at apple.com
Date: 2015-05-10 08:40:44 -0700 (Sun, 10 May 2015)
Log Message:
-----------
Fix priority aggregation logic causing an intermittent test failure.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/push/notifier.py
Modified: CalendarServer/trunk/calendarserver/push/notifier.py
===================================================================
--- CalendarServer/trunk/calendarserver/push/notifier.py 2015-05-07 20:04:40 UTC (rev 14773)
+++ CalendarServer/trunk/calendarserver/push/notifier.py 2015-05-10 15:40:44 UTC (rev 14774)
@@ -58,10 +58,13 @@
maxPriority = self.pushPriority
# If there are other enqueued work items for this push ID, find the
- # highest priority one and use that value
+ # highest priority one and use that value. Note that L{results} will
+ # not contain this work item as job processing behavior will have already
+ # deleted it. So we need to make sure the max priority calculation includes
+ # this one.
if results:
workIDs, jobIDs, priorities = zip(*results)
- maxPriority = max(priorities)
+ maxPriority = max(priorities + (self.pushPriority,))
# Delete the work items and jobs we selected - deleting the job will ensure that there are no
# orphaned" jobs left in the job queue which would otherwise get to run at some later point,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150510/ac626dad/attachment.html>
More information about the calendarserver-changes
mailing list