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

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


Revision: 10263
          http://trac.calendarserver.org//changeset/10263
Author:   glyph at apple.com
Date:     2013-01-04 16:39:26 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
Break it.

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:25 UTC (rev 10262)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py	2013-01-05 00:39:26 UTC (rev 10263)
@@ -104,6 +104,7 @@
 from twisted.internet.endpoints import TCP4ServerEndpoint
 from twext.enterprise.ienterprise import IQueuer
 from zope.interface.interface import Interface
+from twext.enterprise.locking import NamedLock
 
 
 class _IWorkPerformer(Interface):
@@ -812,6 +813,8 @@
     def work(txn):
         workItemClass = WorkItem.forTable(table)
         workItem = yield workItemClass.load(txn, workID)
+        if workItem.group is not None:
+            yield NamedLock.acquire(txn, workItem.group)
         # TODO: what if we fail?  error-handling should be recorded someplace,
         # the row should probably be marked, re-tries should be triggerable
         # administratively.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/671724de/attachment-0001.html>


More information about the calendarserver-changes mailing list