[CalendarServer-changes] [12643] CalendarServer/trunk/txdav/common/datastore
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:17:23 PDT 2014
Revision: 12643
http://trac.calendarserver.org//changeset/12643
Author: cdaboo at apple.com
Date: 2014-02-10 20:08:40 -0800 (Mon, 10 Feb 2014)
Log Message:
-----------
Fix logging and associated tests.
Modified Paths:
--------------
CalendarServer/trunk/txdav/common/datastore/sql.py
CalendarServer/trunk/txdav/common/datastore/test/test_sql.py
Modified: CalendarServer/trunk/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql.py 2014-02-11 02:59:37 UTC (rev 12642)
+++ CalendarServer/trunk/txdav/common/datastore/sql.py 2014-02-11 04:08:40 UTC (rev 12643)
@@ -443,11 +443,11 @@
def _logTransactionWait():
if self.txn is not None:
log.error(
- "Transaction wait: {self.txn}, "
- "Statements: {self.txn.statementCount!d}, "
- "IUDs: {self.txn.iudCount!d}, "
- "Statement: {self.txn.currentStatement}",
- self=self
+ "Transaction wait: {me.txn}, "
+ "Statements: {me.txn.statementCount!d}, "
+ "IUDs: {me.txn.iudCount!d}, "
+ "Statement: {me.txn.currentStatement}",
+ me=self
)
self.delayedLog = self.callLater(
self.logTimerSeconds, _logTransactionWait
@@ -463,11 +463,11 @@
def _forceAbort():
if self.txn is not None:
log.error(
- "Transaction abort too long: {self.txn}, "
- "Statements: {self.txn.statementCount!d}, "
- "IUDs: {self.txn.iudCount!d}, "
- "Statement: {self.txn.currentStatement}",
- self=self
+ "Transaction abort too long: {me.txn}, "
+ "Statements: {me.txn.statementCount!d}, "
+ "IUDs: {me.txn.iudCount!d}, "
+ "Statement: {me.txn.currentStatement}",
+ me=self
)
self.delayedTimeout = None
if self.delayedLog:
Modified: CalendarServer/trunk/txdav/common/datastore/test/test_sql.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/test_sql.py 2014-02-11 02:59:37 UTC (rev 12642)
+++ CalendarServer/trunk/txdav/common/datastore/test/test_sql.py 2014-02-11 04:08:40 UTC (rev 12643)
@@ -100,7 +100,7 @@
self.patch(self._sqlStore, "logTransactionWaits", 1)
ctr = [0]
- def counter(_ignore):
+ def counter(*args, **kwargs):
ctr[0] += 1
self.patch(log, "error", counter)
@@ -123,7 +123,7 @@
self.patch(self._sqlStore, "timeoutTransactions", 1)
ctr = [0]
- def counter(_ignore):
+ def counter(*args, **kwargs):
ctr[0] += 1
self.patch(log, "error", counter)
@@ -149,7 +149,7 @@
self.patch(self._sqlStore, "timeoutTransactions", 2)
ctr = [0, 0]
- def counter(logStr):
+ def counter(logStr, *args, **kwargs):
if "wait" in logStr:
ctr[0] += 1
elif "abort" in logStr:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/c4d6389d/attachment.html>
More information about the calendarserver-changes
mailing list