Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/services/remove_status_service.rb Conflict because we still handle the direct timeline. Took upstream changes, with that one extra function call. - config/locales/ca.yml Conflict because theme names were updated. Decided to *keep* the theme names even if they are useless to avoid future conflicts. - config/locales/oc.yml Decided to *keep* the theme names even if they are useless to avoid future conflicts. - config/locales/pl.yml Decided to *keep* the theme names even if they are useless to avoid future conflicts.
This commit is contained in:
@ -4,7 +4,13 @@ class DistributionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(status_id)
|
||||
FanOutOnWriteService.new.call(Status.find(status_id))
|
||||
RedisLock.acquire(redis: Redis.current, key: "distribute:#{status_id}") do |lock|
|
||||
if lock.acquired?
|
||||
FanOutOnWriteService.new.call(Status.find(status_id))
|
||||
else
|
||||
raise Mastodon::RaceConditionError
|
||||
end
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
Reference in New Issue
Block a user