about summary refs log tree commit diff
path: root/app/workers/pubsubhubbub
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-05 03:18:42 +0200
committerGitHub <noreply@github.com>2017-04-05 03:18:42 +0200
commitbdaf31bcc91d309d667b173bfa660f74d5569474 (patch)
treec36c6c1f2bbc52e5e1d3067db2fbdb202bc1626b /app/workers/pubsubhubbub
parent58bdb9b42ee90ca2723ac28c0f45af40df1c6383 (diff)
parent086a88f3bb3e09ade9d5659d60e5b0445b30dbed (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'app/workers/pubsubhubbub')
-rw-r--r--app/workers/pubsubhubbub/delivery_worker.rb1
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)