mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: hold s3 related distributed locks longer
These operations are pretty expensive and can take multiple minutes due to networking. Hold distributed mutex for much longer.
This commit is contained in:
parent
79957706b1
commit
e53a171916
@ -927,7 +927,7 @@ class Post < ActiveRecord::Base
|
|||||||
missing_post_uploads = {}
|
missing_post_uploads = {}
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
DistributedMutex.synchronize("find_missing_uploads") do
|
DistributedMutex.synchronize("find_missing_uploads", validity: 30.minutes) do
|
||||||
PostCustomField.where(name: Post::MISSING_UPLOADS).delete_all
|
PostCustomField.where(name: Post::MISSING_UPLOADS).delete_all
|
||||||
query = Post
|
query = Post
|
||||||
.have_uploads
|
.have_uploads
|
||||||
|
@ -30,7 +30,7 @@ class S3Inventory
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
DistributedMutex.synchronize("s3_inventory_list_missing_#{type}") do
|
DistributedMutex.synchronize("s3_inventory_list_missing_#{type}", validity: 30.minutes) do
|
||||||
begin
|
begin
|
||||||
files.each do |file|
|
files.each do |file|
|
||||||
next if File.exists?(file[:filename][0...-3])
|
next if File.exists?(file[:filename][0...-3])
|
||||||
|
Loading…
Reference in New Issue
Block a user