mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 07:15:40 +08:00
minor cleanup to previous commit from code review
This commit is contained in:
parent
5302709343
commit
e0e6dae6a7
@ -43,7 +43,7 @@ class OptimizedImage < ActiveRecord::Base
|
|||||||
|
|
||||||
# correct bad thumbnail if needed
|
# correct bad thumbnail if needed
|
||||||
if thumbnail && thumbnail.url.blank?
|
if thumbnail && thumbnail.url.blank?
|
||||||
thumbnail.destroy
|
thumbnail.destroy!
|
||||||
thumbnail = nil
|
thumbnail = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,12 +22,14 @@ class DistributedMutex
|
|||||||
|
|
||||||
while !try_to_get_lock
|
while !try_to_get_lock
|
||||||
sleep 0.001
|
sleep 0.001
|
||||||
attempts += 1
|
|
||||||
# in readonly we will never be able to get a lock
|
# in readonly we will never be able to get a lock
|
||||||
if @using_global_redis && attempts > CHECK_READONLY_ATTEMPT
|
if @using_global_redis
|
||||||
|
attempts += 1
|
||||||
|
if attempts > CHECK_READONLY_ATTEMPT
|
||||||
raise Discourse::ReadOnly
|
raise Discourse::ReadOnly
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user