diff options
Diffstat (limited to 'app/models/uploads/local.rb')
-rw-r--r-- | app/models/uploads/local.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/uploads/local.rb b/app/models/uploads/local.rb index bc1c396347e..43512911a85 100644 --- a/app/models/uploads/local.rb +++ b/app/models/uploads/local.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true module Uploads - class Local - BATCH_SIZE = 100 - + class Local < Base def keys(relation) relation.includes(:model).find_each.map {|u| u.absolute_path } end @@ -16,7 +14,7 @@ module Uploads def delete_keys_async(keys_to_delete) keys_to_delete.each_slice(BATCH_SIZE) do |batch| - UploadDeleteLocalWorker.perform_async(batch) + UploadDeleteWorker.perform_async(self.class, batch) end end @@ -24,12 +22,12 @@ module Uploads def delete_file(path) unless exists?(path) - Sidekiq.logger.warn("File '#{path}' doesn't exist, skipping") + logger.warn("File '#{path}' doesn't exist, skipping") return end unless in_uploads?(path) - Sidekiq.logger.warn("Path '#{path}' is not in uploads dir, skipping") + logger.warn("Path '#{path}' is not in uploads dir, skipping") return end |