From 968a6a9be37b3dcd7d7eb70ad8be887b19b9efbb Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Wed, 17 Feb 2016 09:55:44 +0100 Subject: [PATCH] Release webhooks when response code isn't 200 --- src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php b/src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php index 525ab38..b011609 100644 --- a/src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php +++ b/src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php @@ -76,6 +76,11 @@ public function handle() $log->response_format = $log->payload_format = isset($response->getHeader('Content-Type')[0]) ? $response->getHeader('Content-Type')[0] : null; $log->save(); + + // Retry this job if the webhook response didn't give us a HTTP 200 OK + if ($response->getStatusCode() != 200) { + $this->release(30); + } }); });