Added a config value to ignore server checks

This commit is contained in:
Michael 2018-02-08 13:09:09 +00:00
parent 0093f863fd
commit 8ea572ebd1
2 changed files with 19 additions and 13 deletions

View file

@ -69,6 +69,7 @@ Example: To set the automatic database cleanup process add this line to your .ht
* **ostatus_poll_timeframe** - Defines how old an item can be to try to complete the conversation with it. * **ostatus_poll_timeframe** - Defines how old an item can be to try to complete the conversation with it.
* **paranoia** (Boolean) - Log out users if their IP address changed. * **paranoia** (Boolean) - Log out users if their IP address changed.
* **permit_crawling** (Boolean) - Restricts the search for not logged in users to one search per minute. * **permit_crawling** (Boolean) - Restricts the search for not logged in users to one search per minute.
* **queue_no_dead_check** (Boolean) - Ignore if the target contact or server seems to be dead during queue delivery.
* **worker_debug** (Boolean) - If enabled, it prints out the number of running processes split by priority. * **worker_debug** (Boolean) - If enabled, it prints out the number of running processes split by priority.
* **worker_fetch_limit** - Number of worker tasks that are fetched in a single query. Default is 1. * **worker_fetch_limit** - Number of worker tasks that are fetched in a single query. Default is 1.
* **profiler** (Boolean) - Enable internal timings to help optimize code. Needed for "rendertime" addon. Default is false. * **profiler** (Boolean) - Enable internal timings to help optimize code. Needed for "rendertime" addon. Default is false.

View file

@ -6,6 +6,7 @@ namespace Friendica\Worker;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Queue as QueueModel; use Friendica\Model\Queue as QueueModel;
@ -28,6 +29,8 @@ class Queue
$cachekey_deadguy = 'queue_run:deadguy:'; $cachekey_deadguy = 'queue_run:deadguy:';
$cachekey_server = 'queue_run:server:'; $cachekey_server = 'queue_run:server:';
$no_dead_check = Config::get('system', 'queue_no_dead_check', false);
if (!$queue_id) { if (!$queue_id) {
logger('queue: start'); logger('queue: start');
@ -80,12 +83,13 @@ class Queue
$dead = Cache::get($cachekey_deadguy . $contact['notify']); $dead = Cache::get($cachekey_deadguy . $contact['notify']);
if (!is_null($dead) && $dead) { if (!is_null($dead) && $dead && !$no_dead_check) {
logger('queue: skipping known dead url: ' . $contact['notify']); logger('queue: skipping known dead url: ' . $contact['notify']);
QueueModel::updateTime($q_item['id']); QueueModel::updateTime($q_item['id']);
return; return;
} }
if (!$no_dead_check) {
$server = PortableContact::detectServer($contact['url']); $server = PortableContact::detectServer($contact['url']);
if ($server != "") { if ($server != "") {
@ -104,6 +108,7 @@ class Queue
return; return;
} }
} }
}
$user = dba::selectFirst('user', [], ['uid' => $contact['uid']]); $user = dba::selectFirst('user', [], ['uid' => $contact['uid']]);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {