Skip to content

Commit

Permalink
Do not print verbose info about app updates if there are none
Browse files Browse the repository at this point in the history
This is cosmetical but if you have a large number of apps installed then
you'll see a wall of text during the server and app upgrade when it
tries to update each app via the app store. In may cases nothing will be
updated. For those boring cases we can hide the verbose info, but show
when occ is run with -v. Any actual update will still print a few lines.
Those are the important ones for the admin.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst authored and backportbot[bot] committed Nov 22, 2021
1 parent 3b66b4f commit 25782f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
6 changes: 0 additions & 6 deletions core/Command/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,9 @@ function ($success) use ($output, $self) {
$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use ($output) {
$output->writeln('<comment>Disabled incompatible app: ' . $app . '</comment>');
});
$updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($output) {
$output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>');
});
$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($output) {
$output->writeln('<info>Update app ' . $app . ' from App Store</info>');
});
$updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($output) {
$output->writeln('<info>Checked for update of app "' . $app . '" in App Store </info>');
});
$updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($output) {
$output->writeln("<info>Checking whether the database schema for <$app> can be updated (this can take a long time depending on the database size)</info>");
});
Expand Down
6 changes: 0 additions & 6 deletions core/ajax/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,9 @@ public function handleRepairFeedback($event) {
$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
$eventSource->send('success', $l->t('Updated database'));
});
$updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) {
$eventSource->send('success', $l->t('Checking for update of app "%s" in App Store', [$app]));
});
$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
$eventSource->send('success', $l->t('Update app "%s" from App Store', [$app]));
});
$updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) {
$eventSource->send('success', $l->t('Checked for update of app "%s" in App Store', [$app]));
});
$updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
$eventSource->send('success', $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
});
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ private function logAllEvents(): void {
$log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: ' . $app, ['app' => 'updater']);
});
$this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($log) {
$log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']);
$log->debug('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']);
});
$this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($log) {
$log->info('\OC\Updater::upgradeAppStoreApp: Update app "' . $app . '" from appstore', ['app' => 'updater']);
});
$this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($log) {
$log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']);
$log->debug('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']);
});
$this->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($log) {
$log->info('\OC\Updater::appSimulateUpdate: Checking whether the database schema for <' . $app . '> can be updated (this can take a long time depending on the database size)', ['app' => 'updater']);
Expand Down

0 comments on commit 25782f1

Please sign in to comment.