[CalendarServer-changes] [12729] CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:20:38 PDT 2014


Revision: 12729
          http://trac.calendarserver.org//changeset/12729
Author:   gaya at apple.com
Date:     2014-02-19 14:49:03 -0800 (Wed, 19 Feb 2014)
Log Message:
-----------
fix Delete() in CleanupOneInboxWork.doWork()

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

Modified: CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py	2014-02-19 21:45:57 UTC (rev 12728)
+++ CalendarServer/trunk/txdav/common/datastore/work/inbox_cleanup.py	2014-02-19 22:49:03 UTC (rev 12729)
@@ -34,7 +34,7 @@
 class InboxCleanupWork(WorkItem,
     fromTable(schema.INBOX_CLEANUP_WORK)):
 
-    group = "clean_inboxes"
+    group = "inbox_cleanup"
 
     @classmethod
     @inlineCallbacks
@@ -63,7 +63,7 @@
             yield CleanupOneInboxWork._schedule(self.transaction, homeID=homeRow[0], seconds=0)
 
         # Schedule next check
-        yield InboxCleanupWork._schedule(
+        yield self._schedule(
             self.transaction,
             float(config.InboxCleanupPeriodDays) * 24 * 60 * 60
         )
@@ -73,7 +73,7 @@
 class CleanupOneInboxWork(WorkItem,
     fromTable(schema.CLEANUP_ONE_INBOX_WORK)):
 
-    group = property(lambda self: "clean_inbox_in_homeid_{}".format(self.homeID))
+    group = property(lambda self: "cleanup_inbox_in_homeid_{}".format(self.homeID))
 
     @classmethod
     @inlineCallbacks
@@ -89,7 +89,9 @@
     def doWork(self):
 
         # Delete all other work items for this group (for this home ID)
-        yield Delete(From=self.table, Where=None).on(self.transaction)
+        yield Delete(From=self.table,
+            Where=self.table.HOME_ID == self.homeID
+            ).on(self.transaction)
 
         # get orphan names
         orphanNames = set((
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/f48f4710/attachment.html>


More information about the calendarserver-changes mailing list