[CalendarServer-changes] [13981] CalendarServer/trunk/txdav/common/datastore/work

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 18 14:50:15 PDT 2014


Revision: 13981
          http://trac.calendarserver.org//changeset/13981
Author:   sagen at apple.com
Date:     2014-09-18 14:50:15 -0700 (Thu, 18 Sep 2014)
Log Message:
-----------
Fix cleanup of orphaned inbox items (as well as the unit test)

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py
    CalendarServer/trunk/txdav/common/datastore/work/test/test_inbox_cleanup.py

Modified: CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py	2014-09-18 20:55:52 UTC (rev 13980)
+++ CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py	2014-09-18 21:50:15 UTC (rev 13981)
@@ -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/trunk/txdav/common/datastore/work/test/test_inbox_cleanup.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/work/test/test_inbox_cleanup.py	2014-09-18 20:55:52 UTC (rev 13980)
+++ CalendarServer/trunk/txdav/common/datastore/work/test/test_inbox_cleanup.py	2014-09-18 21:50:15 UTC (rev 13981)
@@ -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/20140918/190ab91d/attachment-0001.html>


More information about the calendarserver-changes mailing list