diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2018-05-16 19:29:45 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-05-16 12:29:45 +0200 |
commit | 55fd55714a374eaedfab457f7e7254f816911ff1 (patch) | |
tree | e1dbfa9c8d836a14269f5f9af79bc0596d283698 /app/controllers | |
parent | 65d6b253fb4d8a81d41ecfa25078205569fcef21 (diff) |
Raise Mastodon::RaceConditionError if Redis lock failed (#7511)
An explicit error allows user agents to know the error and Sidekiq to retry.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/media_proxy_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/media_proxy_controller.rb b/app/controllers/media_proxy_controller.rb index 155670837..d820b257e 100644 --- a/app/controllers/media_proxy_controller.rb +++ b/app/controllers/media_proxy_controller.rb @@ -8,6 +8,8 @@ class MediaProxyController < ApplicationController if lock.acquired? @media_attachment = MediaAttachment.remote.find(params[:id]) redownload! if @media_attachment.needs_redownload? && !reject_media? + else + raise Mastodon::RaceConditionError end end |