mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:49:06 +08: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 = {}
|
||||
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
|
||||
query = Post
|
||||
.have_uploads
|
||||
|
|
|
@ -30,7 +30,7 @@ class S3Inventory
|
|||
return
|
||||
end
|
||||
|
||||
DistributedMutex.synchronize("s3_inventory_list_missing_#{type}") do
|
||||
DistributedMutex.synchronize("s3_inventory_list_missing_#{type}", validity: 30.minutes) do
|
||||
begin
|
||||
files.each do |file|
|
||||
next if File.exists?(file[:filename][0...-3])
|
||||
|
|
Loading…
Reference in New Issue
Block a user