Merge pull request #23438 from nextcloud/disable-notify-self-check-20

[20] add option to disable notify self check
This commit is contained in:
Morris Jobke 2020-10-19 10:12:09 +02:00 committed by GitHub
commit ae5500b0cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -85,6 +85,11 @@ class Notify extends Base {
InputOption::VALUE_REQUIRED, InputOption::VALUE_REQUIRED,
'The directory in the storage to listen for updates in', 'The directory in the storage to listen for updates in',
'/' '/'
)->addOption(
'no-self-check',
'',
InputOption::VALUE_NONE,
'Disable self check on startup'
); );
parent::configure(); parent::configure();
} }
@ -138,7 +143,11 @@ class Notify extends Base {
$path = trim($input->getOption('path'), '/'); $path = trim($input->getOption('path'), '/');
$notifyHandler = $storage->notify($path); $notifyHandler = $storage->notify($path);
if (!$input->getOption('no-self-check')) {
$this->selfTest($storage, $notifyHandler, $verbose, $output); $this->selfTest($storage, $notifyHandler, $verbose, $output);
}
$notifyHandler->listen(function (IChange $change) use ($mount, $verbose, $output) { $notifyHandler->listen(function (IChange $change) use ($mount, $verbose, $output) {
if ($verbose) { if ($verbose) {
$this->logUpdate($change, $output); $this->logUpdate($change, $output);