diff options
author | Eugen <eugen@zeonfederated.com> | 2017-04-05 03:27:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 03:27:38 +0200 |
commit | 4c92f156645f62bd6170df1ce966374574e44ef1 (patch) | |
tree | 8ba55a55df75046b4f0a06151418453d06672f13 /app/workers/pubsubhubbub | |
parent | 5af0ecbcd9cfd757c4d5bd541d83ca11e44d14ef (diff) | |
parent | 94d00f278819d34ef97d59d17eb289e9be217dfe (diff) |
Merge branch 'master' into add_more_tests_to_models
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) |