Pārlūkot izejas kodu

Adding some rescues to workers, e.g. don't fail removal job when status can't be found in the first place (already removed)

master
Eugen Rochko pirms 7 gadiem
vecāks
revīzija
4c6809f6ab
3 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. +2
    -0
      app/workers/distribution_worker.rb
  2. +2
    -0
      app/workers/pubsubhubbub/distribution_worker.rb
  3. +2
    -0
      app/workers/removal_worker.rb

+ 2
- 0
app/workers/distribution_worker.rb Parādīt failu

@@ -5,5 +5,7 @@ class DistributionWorker

def perform(status_id)
FanOutOnWriteService.new.call(Status.find(status_id))
rescue ActiveRecord::RecordNotFound
true
end
end

+ 2
- 0
app/workers/pubsubhubbub/distribution_worker.rb Parādīt failu

@@ -14,5 +14,7 @@ class Pubsubhubbub::DistributionWorker
Subscription.where(account: account).active.select('id').find_each do |subscription|
Pubsubhubbub::DeliveryWorker.perform_async(subscription.id, payload)
end
rescue ActiveRecord::RecordNotFound
true
end
end

+ 2
- 0
app/workers/removal_worker.rb Parādīt failu

@@ -5,5 +5,7 @@ class RemovalWorker

def perform(status_id)
RemoveStatusService.new.call(Status.find(status_id))
rescue ActiveRecord::RecordNotFound
true
end
end

Notiek ielāde…
Atcelt
Saglabāt