mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
Fix the build.
This commit is contained in:
parent
b0c8fdd7da
commit
243fb8d9ad
|
@ -129,7 +129,7 @@ module FileStore
|
|||
S3Inventory.new(s3_helper, :upload).backfill_etags_and_list_missing
|
||||
S3Inventory.new(s3_helper, :optimized).backfill_etags_and_list_missing unless skip_optimized
|
||||
else
|
||||
list_missing(Upload, "original/")
|
||||
list_missing(Upload.by_users, "original/")
|
||||
list_missing(OptimizedImage, "optimized/") unless skip_optimized
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ class S3Inventory
|
|||
WHERE #{model.table_name}.etag IS NULL
|
||||
AND url ILIKE '%' || #{table_name}.key")
|
||||
|
||||
uploads = (model == Upload) ? model.where("created_at < ?", inventory_date) : model
|
||||
uploads = (model == Upload) ? model.by_users.where("created_at < ?", inventory_date) : model
|
||||
missing_uploads = uploads.joins("LEFT JOIN #{table_name} ON #{table_name}.etag = #{model.table_name}.etag").where("#{table_name}.etag is NULL")
|
||||
|
||||
if (missing_count = missing_uploads.count) > 0
|
||||
|
|
|
@ -61,6 +61,7 @@ describe "S3Inventory" do
|
|||
CSV.foreach(csv_filename, headers: false) do |row|
|
||||
Fabricate(:upload, etag: row[S3Inventory::CSV_ETAG_INDEX], created_at: 2.days.ago)
|
||||
end
|
||||
|
||||
upload = Fabricate(:upload, etag: "ETag", created_at: 1.days.ago)
|
||||
Fabricate(:upload, etag: "ETag2", created_at: Time.now)
|
||||
|
||||
|
@ -91,6 +92,6 @@ describe "S3Inventory" do
|
|||
expect { inventory.backfill_etags_and_list_missing }.to change { Upload.where(etag: nil).count }.by(-2)
|
||||
end
|
||||
|
||||
expect(Upload.order(:url).pluck(:url, :etag)).to eq(files)
|
||||
expect(Upload.by_users.order(:url).pluck(:url, :etag)).to eq(files)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -274,7 +274,7 @@ describe ApplicationHelper do
|
|||
).to include("some-image.png")
|
||||
|
||||
expect(helper.crawlable_meta_data).to include(
|
||||
SiteSetting.opengraph_image_url
|
||||
SiteSetting.site_opengraph_image_url
|
||||
)
|
||||
|
||||
SiteSetting.opengraph_image = nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user