FEATURE: add toggle for uploads:missing so it can skip external

Validating s3 uploads in uploads:missing can be very expensive, allow to
bypass.
This commit is contained in:
Sam Saffron 2019-05-21 16:06:35 +10:00
parent c86d2666c4
commit cb86d8279a

View File

@ -589,7 +589,11 @@ task "uploads:missing" => :environment do
list_missing_uploads(skip_optimized: ENV['SKIP_OPTIMIZED']) list_missing_uploads(skip_optimized: ENV['SKIP_OPTIMIZED'])
else else
RailsMultisite::ConnectionManagement.each_connection do |db| RailsMultisite::ConnectionManagement.each_connection do |db|
list_missing_uploads(skip_optimized: ENV['SKIP_OPTIMIZED']) if ENV["SKIP_EXTERNAL"] == "1" && Discourse.store.external?
puts "#{RailsMultisite::ConnectionManagement.current_db} has uploads stored externally skipping!"
else
list_missing_uploads(skip_optimized: ENV['SKIP_OPTIMIZED'])
end
end end
end end
end end