about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dtas/mlib.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/dtas/mlib.rb b/lib/dtas/mlib.rb
index 09856ee..a01a136 100644
--- a/lib/dtas/mlib.rb
+++ b/lib/dtas/mlib.rb
@@ -298,8 +298,10 @@ class DTAS::Mlib # :nodoc:
       dir = dir_vivify(@pwd.split(%r{/+}n), st.ctime.to_i)
       dir_id = dir[:id]
 
-      @db[:nodes].where(parent_id: dir_id).each do |node|
-        File.exist?(node[:name]) or remove_entry(node)
+      @db.transaction do
+        @db[:nodes].where(parent_id: dir_id).each do |node|
+          File.exist?(node[:name]) or remove_entry(node)
+        end
       end
 
       Dir.foreach('.', encoding: Encoding::BINARY) do |x|