[CalendarServer-changes] [15713] CalendarServer/trunk/txdav

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 28 09:15:48 PDT 2016


Revision: 15713
          http://trac.calendarserver.org//changeset/15713
Author:   cdaboo at apple.com
Date:     2016-06-28 09:15:48 -0700 (Tue, 28 Jun 2016)
Log Message:
-----------
Make sure sqlite file is closed before we delete it.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py
    CalendarServer/trunk/txdav/common/datastore/file.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py	2016-06-28 14:07:20 UTC (rev 15712)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py	2016-06-28 16:15:48 UTC (rev 15713)
@@ -42,6 +42,7 @@
         oldDB.createToken(
             "urn:uuid:user01", "mailto:attendee at example.com",
             "icaluid1", token="token1")
+        oldDB._db_close()
         yield migrateTokensToStore(self.path, self.store)
         txn = self.store.newTransaction()
         records = yield (txn.imipLookupByToken("token1"))
@@ -49,4 +50,3 @@
         self.assertEquals(records[0].organizer, "urn:uuid:user01")
         self.assertEquals(records[0].attendee, "mailto:attendee at example.com")
         self.assertEquals(records[0].icaluid, "icaluid1")
-        oldDB._db_close()

Modified: CalendarServer/trunk/txdav/common/datastore/file.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/file.py	2016-06-28 14:07:20 UTC (rev 15712)
+++ CalendarServer/trunk/txdav/common/datastore/file.py	2016-06-28 16:15:48 UTC (rev 15713)
@@ -1129,6 +1129,7 @@
 
             def cleanup():
                 try:
+                    self.retrieveOldIndex()._db_close() # Must close sqlite file before it is deleted
                     trash.remove()
                     self.properties()._removeResource()
                 except Exception, e:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160628/06f9a671/attachment.html>


More information about the calendarserver-changes mailing list