diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-19 18:50:24 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:43:59 -0500 |
commit | 21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 (patch) | |
tree | e577d047af196823227e675dea52b2fc2fa842c6 /app/workers/distribution_worker.rb | |
parent | 8c8ad0ac0ed0d3e67f3e521068b59edd4054f1e9 (diff) |
[Feature] Add manual publishing option
Diffstat (limited to 'app/workers/distribution_worker.rb')
-rw-r--r-- | app/workers/distribution_worker.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/workers/distribution_worker.rb b/app/workers/distribution_worker.rb index 4e20ef31b..765cd76c8 100644 --- a/app/workers/distribution_worker.rb +++ b/app/workers/distribution_worker.rb @@ -3,10 +3,11 @@ class DistributionWorker include Sidekiq::Worker - def perform(status_id) + def perform(status_id, only_to_self = false) RedisLock.acquire(redis: Redis.current, key: "distribute:#{status_id}") do |lock| if lock.acquired? - FanOutOnWriteService.new.call(Status.find(status_id)) + status = Status.find(status_id) + FanOutOnWriteService.new.call(status, only_to_self: !status.published? || only_to_self) else raise Mastodon::RaceConditionError end |