about summary refs log tree commit diff
path: root/app/workers/scheduler
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r--app/workers/scheduler/boosts_scheduler.rb10
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