Skip to content

Commit

Permalink
Release webhooks when response code isn't 200
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Pociot committed Feb 17, 2016
1 parent 4769289 commit 968a6a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});

Expand Down

0 comments on commit 968a6a9

Please sign in to comment.