[Zope3-checkins] CVS: Zope3/src/zodb/storage/file - main.py:1.5

Jeremy Hylton jeremy@zope.com
Mon, 19 May 2003 11:03:37 -0400


Update of /cvs-repository/Zope3/src/zodb/storage/file
In directory cvs.zope.org:/tmp/cvs-serv26926/storage/file

Modified Files:
	main.py 
Log Message:
Move the check for empty storage above the lock acquire.


=== Zope3/src/zodb/storage/file/main.py 1.4 => 1.5 ===
--- Zope3/src/zodb/storage/file/main.py:1.4	Thu May 15 17:00:54 2003
+++ Zope3/src/zodb/storage/file/main.py	Mon May 19 11:03:36 2003
@@ -866,6 +866,10 @@
         if stop == ZERO:
             raise FileStorageError("Invalid pack time")
 
+        # If the storage is empty, there's nothing to do.
+        if not self._index:
+            return
+
         # Record pack time so we don't undo while packing
         self._lock_acquire()
         try:
@@ -878,10 +882,6 @@
             self._packt = None
         finally:
             self._lock_release()
-
-        # If the storage is empty, there's nothing to do.
-        if not self._index:
-            return
 
         p = FileStoragePacker(self._name, stop,
                               self._lock_acquire, self._lock_release,