X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FServerBlock.php;h=4d04dcff81e0d23847af76a05fe399728f1ea8b6;hb=e659a0314086dd700dbe5e754e383ab758725805;hp=46e7b89eb99deb8f48a280768f27c376811f39ad;hpb=360614d2cf3aceeb763ef1281ad5236878f5d735;p=friendica.git diff --git a/src/Console/ServerBlock.php b/src/Console/ServerBlock.php index 46e7b89eb9..4d04dcff81 100644 --- a/src/Console/ServerBlock.php +++ b/src/Console/ServerBlock.php @@ -24,6 +24,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\Console; use Console_Table; +use Friendica\Core\Worker; use Friendica\Moderation\DomainPatternBlocklist; /** @@ -106,6 +107,11 @@ HELP; { $filename = $this->getArgument(1); + if (empty($filename)) { + $this->out('A file name is required, e.g. ./bin/console serverblock export backup.csv'); + return 1; + } + $this->blocklist->exportToFile($filename); // Success @@ -127,6 +133,7 @@ HELP; if ($this->blocklist->append($newBlockList)) { $this->out(sprintf("Entries from %s that were not blocked before are now blocked", $filename)); + Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers'); return 0; } else { $this->out("Couldn't save the block list"); @@ -169,6 +176,7 @@ HELP; } else { $this->out(sprintf("The domain pattern '%s' is now blocked. (Reason: '%s')", $pattern, $reason)); } + Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers'); return 0; } else { $this->out(sprintf("Couldn't save '%s' as blocked domain pattern", $pattern)); @@ -193,6 +201,7 @@ HELP; if ($result) { if ($result == 2) { $this->out(sprintf("The domain pattern '%s' isn't blocked anymore", $pattern)); + Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers'); return 0; } else { $this->out(sprintf("The domain pattern '%s' wasn't blocked.", $pattern));