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:
Sam Saffron 2019-08-15 11:48:08 +10:00
parent 79957706b1
commit e53a171916
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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])