From d0689fb707c4b7f8d0a83b105d46902ccdade845 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 15 Nov 2021 14:34:09 +0100 Subject: [PATCH] Do not print verbose info about app updates if there are none 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 --- core/Command/Upgrade.php | 6 ------ core/ajax/update.php | 6 ------ lib/private/Updater.php | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 7ab5fe8e5fd..ef787975209 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -212,15 +212,9 @@ class Upgrade extends Command { $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use ($output) { $output->writeln('Disabled incompatible app: ' . $app . ''); }); - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($output) { - $output->writeln('Checking for update of app ' . $app . ' in appstore'); - }); $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($output) { $output->writeln('Update app ' . $app . ' from appstore'); }); - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($output) { - $output->writeln('Checked for update of app "' . $app . '" in appstore '); - }); $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($output) { $output->writeln('Checking updates of apps'); }); diff --git a/core/ajax/update.php b/core/ajax/update.php index 09931ec91e2..1459507eaaa 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -171,15 +171,9 @@ if (\OCP\Util::needUpgrade()) { $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) { $eventSource->send('success', $l->t('Checking updates of apps')); }); - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) { - $eventSource->send('success', $l->t('Checking for update of app "%s" in appstore', [$app])); - }); $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) { $eventSource->send('success', $l->t('Update app "%s" from appstore', [$app])); }); - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) { - $eventSource->send('success', $l->t('Checked for update of app "%s" in appstore', [$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])); }); diff --git a/lib/private/Updater.php b/lib/private/Updater.php index a8711944341..1708b339e8d 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -558,13 +558,13 @@ class Updater extends BasicEmitter { $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', 'appUpgradeCheckBefore', function () use ($log) { $log->info('\OC\Updater::appUpgradeCheckBefore: Checking updates of apps', ['app' => 'updater']);