diff options
author | JantsoP <jantso.porali@gmail.com> | 2017-04-05 10:07:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 10:07:17 +0200 |
commit | 20b53e6add351e5bb5ff1bd4d675db6252e03293 (patch) | |
tree | e252e354e63765d1f28919f2ac58de26001806cb /app/workers/pubsubhubbub | |
parent | 3ec221d3b7093e2a2606ec04036cca9e9f1f733d (diff) | |
parent | ccb6a658fd1a2e596c95d5b8e7a39f72a5f5b14b (diff) |
Merge branch 'master' into master
Diffstat (limited to 'app/workers/pubsubhubbub')
-rw-r--r-- | app/workers/pubsubhubbub/delivery_worker.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/workers/pubsubhubbub/delivery_worker.rb b/app/workers/pubsubhubbub/delivery_worker.rb index 15005bc80..466def3a8 100644 --- a/app/workers/pubsubhubbub/delivery_worker.rb +++ b/app/workers/pubsubhubbub/delivery_worker.rb @@ -22,6 +22,7 @@ class Pubsubhubbub::DeliveryWorker .headers(headers) .post(subscription.callback_url, body: payload) + return subscription.destroy! if response.code > 299 && response.code < 500 && response.code != 429 # HTTP 4xx means error is not temporary, except for 429 (throttling) raise "Delivery failed for #{subscription.callback_url}: HTTP #{response.code}" unless response.code > 199 && response.code < 300 subscription.touch(:last_successful_delivery_at) |