[CalendarServer-changes] [6871] CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/ adbapi2.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 3 15:41:46 PST 2011


Revision: 6871
          http://trac.macosforge.org/projects/calendarserver/changeset/6871
Author:   glyph at apple.com
Date:     2011-02-03 15:41:45 -0800 (Thu, 03 Feb 2011)
Log Message:
-----------
Fix for the test.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py

Modified: CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py	2011-02-03 23:41:42 UTC (rev 6870)
+++ CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py	2011-02-03 23:41:45 UTC (rev 6871)
@@ -478,21 +478,19 @@
 
         @return: an L{IAsyncTransaction}
         """
-        tracking = self._busy
         if self._stopping:
-            basetxn = _NoTxn()
-            tracking = []
-        elif self._free:
+            return _NoTxn()
+        if self._free:
             basetxn = self._free.pop(0)
+            self._busy.append(basetxn)
+            txn = _SingleTxn(self, basetxn)
         else:
-            basetxn = _WaitingTxn()
-            tracking = self._waiting
-        txn = _SingleTxn(self, basetxn)
-        tracking.append(txn)
-        # FIXME/TESTME: should be len(self._busy) + len(self._finishing) (free
-        # doesn't need to be considered, as it's tested above)
-        if tracking is self._waiting and len(self._busy) < self.maxConnections:
-            self._startOneMore()
+            txn = _SingleTxn(self, _WaitingTxn())
+            self._waiting.append(txn)
+            # FIXME/TESTME: should be len(self._busy) + len(self._finishing)
+            # (free doesn't need to be considered, as it's tested above)
+            if len(self._busy) < self.maxConnections:
+                self._startOneMore()
         return txn
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110203/f6815aca/attachment.html>


More information about the calendarserver-changes mailing list