From: Michael Date: Sat, 14 May 2022 11:09:59 +0000 (+0000) Subject: Add additional timeout checks X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=43dbd1c396d7b3baedfea909a43e808d57785b98;p=friendica.git Add additional timeout checks --- diff --git a/src/Worker/APDelivery.php b/src/Worker/APDelivery.php index e341787e21..ce39398374 100644 --- a/src/Worker/APDelivery.php +++ b/src/Worker/APDelivery.php @@ -23,6 +23,7 @@ namespace Friendica\Worker; use Friendica\Core\Logger; use Friendica\Core\Worker; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\GServer; use Friendica\Model\Post; @@ -152,6 +153,15 @@ class APDelivery $success = $response->isSuccess(); $timeout = $response->isTimeout(); if (!$success) { + $xrd_timeout = DI::config()->get('system', 'xrd_timeout'); + if (!$timeout && $xrd_timeout && ($runtime > $xrd_timeout)) { + $timeout = true; + } + $curl_timeout = DI::config()->get('system', 'curl_timeout'); + if (!$timeout && $curl_timeout && ($runtime > $curl_timeout)) { + $timeout = true; + } + Logger::debug('Delivery failed', ['retcode' => $response->getReturnCode(), 'timeout' => $timeout, 'runtime' => round($runtime, 3), 'uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox]); } if ($uri_id) {