0
0
Fork 0

Rename with_lock to with_redis_lock to avoid confusion with ActiveRecord's method (#24741)

This commit is contained in:
Matt Jankowski 2023-05-02 12:16:07 -04:00 committed by GitHub
parent a7df578f97
commit f1c1dd0118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 19 additions and 26 deletions

View file

@ -16,7 +16,7 @@ class MediaProxyController < ApplicationController
rescue_from HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, with: :internal_server_error
def show
with_lock("media_download:#{params[:id]}") do
with_redis_lock("media_download:#{params[:id]}") do
@media_attachment = MediaAttachment.remote.attached.find(params[:id])
authorize @media_attachment.status, :show?
redownload! if @media_attachment.needs_redownload? && !reject_media?

View file

@ -15,7 +15,7 @@ class Settings::ExportsController < Settings::BaseController
def create
backup = nil
with_lock("backup:#{current_user.id}") do
with_redis_lock("backup:#{current_user.id}") do
authorize :backup, :create?
backup = current_user.backups.create!
end