Improved config description / use the delete command

This commit is contained in:
Michael 2023-03-18 21:34:15 +00:00
parent a151cf450a
commit 04b2d2339e
2 changed files with 3 additions and 3 deletions

View File

@ -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()]);
}
}
}

View File

@ -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)