Browse Source

Improved memory usage on verify storage contend based on checksums.

Martin Edenhofer 7 years ago
parent
commit
e3214e3ac2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/models/store/file.rb

+ 3 - 1
app/models/store/file.rb

@@ -78,7 +78,9 @@ in case of fixing sha hash use:
 
     def self.verify(fix_it = nil)
       success = true
-      Store::File.all.each { |item|
+      file_ids = Store::File.all.pluck(:id)
+      file_ids.each { |item_id|
+        item = Store::File.find(item_id)
         content = item.content
         sha = Digest::SHA256.hexdigest(content)
         logger.info "CHECK: Store::File.find(#{item.id})"