diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-02-05 12:31:29 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-05 12:31:29 -0600 |
commit | 7a716419abbf116dce4d3d4d346a8256e1bbecad (patch) | |
tree | 12470fe1348a0d4ff092dea96f6fa81f4f00f1a5 /app/workers | |
parent | c6861cf96bd1cb089be87fdd44d6527ff23ed39d (diff) |
delayed boosts queue no longer freezes up if one fails due to the author changing their access policy
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/scheduler/boosts_scheduler.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/workers/scheduler/boosts_scheduler.rb b/app/workers/scheduler/boosts_scheduler.rb index de0d89992..c1404a708 100644 --- a/app/workers/scheduler/boosts_scheduler.rb +++ b/app/workers/scheduler/boosts_scheduler.rb @@ -29,8 +29,14 @@ class Scheduler::BoostsScheduler interval = rand(from_interval .. to_interval).minutes redis.setex("queued_boost:#{account.id}", interval, 1) - ReblogStatusWorker.perform_async(account.id, q.first.status_id, distribute: true) - q.destroy_all + + begin + ReblogStatusWorker.perform_async(account.id, q.first.status_id, distribute: true) + rescue Mastodon::NotPermittedError + false + ensure + q.destroy_all + end end end |