diff --git a/app/models/post.rb b/app/models/post.rb index f9f565d6683..3cbe11e6737 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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 diff --git a/lib/s3_inventory.rb b/lib/s3_inventory.rb index ebe40fddf11..b69f4a0e719 100644 --- a/lib/s3_inventory.rb +++ b/lib/s3_inventory.rb @@ -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])