Don't notify admins if no potentially over exposing links found

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2019-06-03 21:41:32 +02:00
parent 32154bc6cf
commit 567fe4b833
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 7 additions and 7 deletions

View File

@ -201,8 +201,7 @@ class RemoveLinkShares implements IRepairStep {
}
}
private function repair(IOutput $output) {
$total = $this->getTotal();
private function repair(IOutput $output, int $total) {
$output->startProgress($total);
$shareCursor = $this->getShares();
@ -225,12 +224,13 @@ class RemoveLinkShares implements IRepairStep {
}
public function run(IOutput $output) {
if ($this->shouldRun()) {
$output->info('Removing potentially over exposing link shares');
$this->repair($output);
$output->info('Removed potentially over exposing link shares');
} else {
if ($this->shouldRun() === false || ($total = $this->getTotal()) === 0) {
$output->info('No need to remove link shares.');
return;
}
$output->info('Removing potentially over exposing link shares');
$this->repair($output, $total);
$output->info('Removed potentially over exposing link shares');
}
}