DEV: Rename new upload rake tasks

These tasks are s3-specific, so update the names to make that very clear
This commit is contained in:
David Taylor 2020-08-12 23:26:13 +01:00
parent ced8cdad24
commit 451b9b245f
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
1 changed files with 8 additions and 8 deletions

View File

@ -995,7 +995,7 @@ task "uploads:fix_relative_upload_links" => :environment do
end
end
def analyze_missing
def analyze_missing_s3
puts "List of posts with missing images:"
sql = <<~SQL
SELECT post_id, url, sha1, extension, uploads.id
@ -1053,17 +1053,17 @@ def analyze_missing
end
task "uploads:analyze_missing" => :environment do
task "uploads:analyze_missing_s3" => :environment do
if RailsMultisite::ConnectionManagement.current_db != "default"
analyze_missing
analyze_missing_s3
else
RailsMultisite::ConnectionManagement.each_connection do
analyze_missing
analyze_missing_s3
end
end
end
def fix_missing
def fix_missing_s3
Jobs.run_immediately!
puts "Attempting to automatically fix problem uploads"
puts
@ -1085,12 +1085,12 @@ def fix_missing
puts
end
task "uploads:fix_missing" => :environment do
task "uploads:fix_missing_s3" => :environment do
if RailsMultisite::ConnectionManagement.current_db != "default"
fix_missing
fix_missing_s3
else
RailsMultisite::ConnectionManagement.each_connection do
fix_missing
fix_missing_s3
end
end
end