]> git.mxchange.org Git - friendica.git/commitdiff
Add additional timeout checks
authorMichael <heluecht@pirati.ca>
Sat, 14 May 2022 11:09:59 +0000 (11:09 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 14 May 2022 11:09:59 +0000 (11:09 +0000)
src/Worker/APDelivery.php

index e341787e21151bdc7740936f00daaeca4a81dc2e..ce393983741827911a90f2eb01556961e72346fd 100644 (file)
@@ -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) {