Added a config value to ignore server checks
This commit is contained in:
parent
0093f863fd
commit
8ea572ebd1
2 changed files with 19 additions and 13 deletions
|
@ -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.
|
||||
* **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.
|
||||
* **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_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.
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace Friendica\Worker;
|
|||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Queue as QueueModel;
|
||||
|
@ -28,6 +29,8 @@ class Queue
|
|||
$cachekey_deadguy = 'queue_run:deadguy:';
|
||||
$cachekey_server = 'queue_run:server:';
|
||||
|
||||
$no_dead_check = Config::get('system', 'queue_no_dead_check', false);
|
||||
|
||||
if (!$queue_id) {
|
||||
logger('queue: start');
|
||||
|
||||
|
@ -80,28 +83,30 @@ class Queue
|
|||
|
||||
$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']);
|
||||
QueueModel::updateTime($q_item['id']);
|
||||
return;
|
||||
}
|
||||
|
||||
$server = PortableContact::detectServer($contact['url']);
|
||||
if (!$no_dead_check) {
|
||||
$server = PortableContact::detectServer($contact['url']);
|
||||
|
||||
if ($server != "") {
|
||||
$vital = Cache::get($cachekey_server . $server);
|
||||
if ($server != "") {
|
||||
$vital = Cache::get($cachekey_server . $server);
|
||||
|
||||
if (is_null($vital)) {
|
||||
logger("Check server " . $server . " (" . $contact["network"] . ")");
|
||||
if (is_null($vital)) {
|
||||
logger("Check server " . $server . " (" . $contact["network"] . ")");
|
||||
|
||||
$vital = PortableContact::checkServer($server, $contact["network"], true);
|
||||
Cache::set($cachekey_server . $server, $vital, CACHE_QUARTER_HOUR);
|
||||
}
|
||||
$vital = PortableContact::checkServer($server, $contact["network"], true);
|
||||
Cache::set($cachekey_server . $server, $vital, CACHE_QUARTER_HOUR);
|
||||
}
|
||||
|
||||
if (!is_null($vital) && !$vital) {
|
||||
logger('queue: skipping dead server: ' . $server);
|
||||
QueueModel::updateTime($q_item['id']);
|
||||
return;
|
||||
if (!is_null($vital) && !$vital) {
|
||||
logger('queue: skipping dead server: ' . $server);
|
||||
QueueModel::updateTime($q_item['id']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue