[CalendarServer-changes] [13995] CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common /datastore/work

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 22 14:01:05 PDT 2014


Revision: 13995
          http://trac.calendarserver.org//changeset/13995
Author:   sagen at apple.com
Date:     2014-09-22 14:01:05 -0700 (Mon, 22 Sep 2014)
Log Message:
-----------
Pull in r13981 from trunk (Fix cleanup of orphaned inbox items (as well as the unit test))

Revision Links:
--------------
    http://trac.calendarserver.org//changeset/13981

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/inbox_cleanup.py
    CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/test/test_inbox_cleanup.py

Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/inbox_cleanup.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/inbox_cleanup.py	2014-09-22 19:48:56 UTC (rev 13994)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/inbox_cleanup.py	2014-09-22 21:01:05 UTC (rev 13995)
@@ -96,7 +96,7 @@
         if orphanNames:
             home = yield self.transaction.calendarHomeWithResourceID(self.homeID)
             log.info("Inbox cleanup work in home: {homeUID}, deleting orphaned items: {orphanNames}".format(
-                homeID=self.uid(), orphanNames=orphanNames))
+                homeUID=home.uid(), orphanNames=orphanNames))
 
         # get old item names
         if float(config.InboxCleanup.ItemLifetimeDays) >= 0: # use -1 to disable; 0 is test case

Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/test/test_inbox_cleanup.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/test/test_inbox_cleanup.py	2014-09-22 19:48:56 UTC (rev 13994)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/common/datastore/work/test/test_inbox_cleanup.py	2014-09-22 21:01:05 UTC (rev 13995)
@@ -162,12 +162,12 @@
         self.patch(config.InboxCleanup, "ItemLifeBeyondEventEndDays", -1)
 
         # create orphans by deleting events
-        inbox = yield self.calendarUnderTest(home="user01", name="inbox")
-        for item in (yield inbox.objectResourcesWithNames(["cal1.ics", "cal3.ics"])):
+        cal = yield self.calendarUnderTest(home="user01", name="calendar")
+        for item in (yield cal.objectResourcesWithNames(["cal1.ics", "cal3.ics"])):
             yield item.remove()
 
         # do cleanup
-        yield self.transactionUnderTest().enqueue(CleanupOneInboxWork, homeID=inbox.ownerHome()._resourceID, notBefore=datetime.datetime.utcnow())
+        yield self.transactionUnderTest().enqueue(CleanupOneInboxWork, homeID=cal.ownerHome()._resourceID, notBefore=datetime.datetime.utcnow())
         yield self.commit()
         yield JobItem.waitEmpty(self.storeUnderTest().newTransaction, reactor, 60)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140922/596295ea/attachment.html>


More information about the calendarserver-changes mailing list