properly empty and remove files when Depot#gc! has not been called for a while
authorLunar <lunar@anargeek.net>
Tue, 6 Mar 2012 16:05:34 +0000 (17:05 +0100)
committerLunar <lunar@anargeek.net>
Fri, 23 Mar 2012 17:11:28 +0000 (18:11 +0100)
lib/coquelicot/depot.rb

index 6ac491d..5d37d93 100644 (file)
@@ -61,7 +61,8 @@ module Coquelicot
         if File.lstat(path).size > 0
           file = StoredFile::open path
           file.empty! if file.expired?
-        elsif Time.now - File.lstat(path).mtime > (Coquelicot.settings.gone_period * 60)
+        end
+        if Time.now - File.lstat(path).mtime > (Coquelicot.settings.gone_period * 60)
           remove_from_links { |l| l.strip.end_with? " #{name}" }
           File.unlink path
         end