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

th-downstream
Eugen Rochko 8 years ago
parent b2945b025f
commit 0f4c9d1124

@ -5,5 +5,7 @@ class DistributionWorker
def perform(status_id) def perform(status_id)
FanOutOnWriteService.new.call(Status.find(status_id)) FanOutOnWriteService.new.call(Status.find(status_id))
rescue ActiveRecord::RecordNotFound
true
end end
end end

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

@ -5,5 +5,7 @@ class RemovalWorker
def perform(status_id) def perform(status_id)
RemoveStatusService.new.call(Status.find(status_id)) RemoveStatusService.new.call(Status.find(status_id))
rescue ActiveRecord::RecordNotFound
true
end end
end end

Loading…
Cancel
Save