From: Michael Date: Sat, 18 Mar 2023 21:34:15 +0000 (+0000) Subject: Improved config description / use the delete command X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=04b2d2339e9e99ddb67c9668474988ae343bc8a2;p=friendica.git Improved config description / use the delete command --- diff --git a/src/Worker/UpdateBlockedServers.php b/src/Worker/UpdateBlockedServers.php index d2b5255d59..980897939c 100644 --- a/src/Worker/UpdateBlockedServers.php +++ b/src/Worker/UpdateBlockedServers.php @@ -57,8 +57,8 @@ class UpdateBlockedServers if (DI::config()->get('system', 'delete-blocked-servers')) { Logger::info('Delete blocked servers - start'); - DBA::p("DELETE FROM `gserver` WHERE `blocked` AND NOT EXISTS(SELECT `gsid` FROM `inbox-status` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `contact` WHERE gsid= `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `apcontact` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `delivery-queue` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `diaspora-contact` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gserver-id` FROM `gserver-tag` WHERE `gserver-id` = `gserver`.`id`)"); - Logger::info('Delete blocked servers - done', ['rows' => DBA::affectedRows()]); + $ret = DBA::delete('gserver', ["`blocked` AND NOT EXISTS(SELECT `gsid` FROM `inbox-status` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `contact` WHERE gsid= `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `apcontact` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `delivery-queue` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gsid` FROM `diaspora-contact` WHERE `gsid` = `gserver`.`id`) AND NOT EXISTS(SELECT `gserver-id` FROM `gserver-tag` WHERE `gserver-id` = `gserver`.`id`)"]); + Logger::info('Delete blocked servers - done', ['ret' => $ret, 'rows' => DBA::affectedRows()]); } } } diff --git a/static/defaults.config.php b/static/defaults.config.php index 14e6d6f0ed..4fb96cfce2 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -238,7 +238,7 @@ return [ 'delete_sleeping_processes' => false, // delete-blocked-servers (Boolean) - // Delete blocked servers if possible. + // Delete blocked servers if there are no foreign key violations. 'delete-blocked-servers' => false, // dice_profiler_threshold (Float)