$this->
markWebhookEventFailed($webhookEventLogId);
/** @var WebhookEntity|null $webhook */
$webhook =
$this->webhookRepository
->
search(new Criteria([$webhookId]), Context::
createDefaultContext()) ->
get($webhookId);
if ($webhook === null || !
$webhook->
isActive()) { return;
} $webhookErrorCount =
$webhook->
getErrorCount() + 1;
$params =
[ 'id' =>
$webhook->
getId(),
'errorCount' =>
$webhookErrorCount,
];
if ($webhookErrorCount >= self::MAX_WEBHOOK_ERROR_COUNT
) { $params =
array_merge($params,
[ 'errorCount' => 0,
'active' => false,
]);
}