[CalendarServer-changes] [3515] CalendarServer/trunk/twistedcaldav/method/put_common.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Dec 11 18:49:10 PST 2008
Revision: 3515
http://trac.macosforge.org/projects/calendarserver/changeset/3515
Author: cdaboo at apple.com
Date: 2008-12-11 18:49:10 -0800 (Thu, 11 Dec 2008)
Log Message:
-----------
Make sure that the quota adjustment for the source of a copy happens after indexing of the destination
just in case indexing fails and requires a rollback that would invalidate the quota adjustment.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/method/put_common.py
Modified: CalendarServer/trunk/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/put_common.py 2008-12-11 20:21:38 UTC (rev 3514)
+++ CalendarServer/trunk/twistedcaldav/method/put_common.py 2008-12-12 02:49:10 UTC (rev 3515)
@@ -783,14 +783,18 @@
self.rollback.source_deleted = True
log.debug("Source removed %s" % (self.source.fp.path,))
+ # Change CTag on the parent calendar collection
+ if self.sourcecal:
+ yield self.sourceparent.updateCTag()
+
+ returnValue(None)
+
+ @inlineCallbacks
+ def doSourceQuotaCheck(self):
# Update quota
if self.sourcequota is not None:
delete_size = 0 - self.old_source_size
yield self.source.quotaSizeAdjust(self.request, delete_size)
-
- # Change CTag on the parent calendar collection
- if self.sourcecal:
- yield self.sourceparent.updateCTag()
returnValue(None)
@@ -1006,6 +1010,10 @@
self.rollback.Rollback()
returnValue(result)
+ # Delete the original source if needed.
+ if self.deletesource:
+ yield self.doSourceQuotaCheck()
+
# Do quota check on destination
if self.destquota is not None:
yield self.doDestinationQuotaCheck()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081211/55911d4a/attachment.html>
More information about the calendarserver-changes
mailing list