X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FServerBlock.php;h=4d04dcff81e0d23847af76a05fe399728f1ea8b6;hb=e659a0314086dd700dbe5e754e383ab758725805;hp=65b806fc70f5fc0a653c9b67540247d97c077507;hpb=97ccb4d2c45ff705d6f776cc9a841f0680d8238f;p=friendica.git diff --git a/src/Console/ServerBlock.php b/src/Console/ServerBlock.php index 65b806fc70..4d04dcff81 100644 --- a/src/Console/ServerBlock.php +++ b/src/Console/ServerBlock.php @@ -1,6 +1,6 @@ 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));