From 7a716419abbf116dce4d3d4d346a8256e1bbecad Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 5 Feb 2020 12:31:29 -0600 Subject: delayed boosts queue no longer freezes up if one fails due to the author changing their access policy --- app/workers/scheduler/boosts_scheduler.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/workers/scheduler') 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 -- cgit