Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-05-12 11:16:43 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-05-12 11:17:27 +0300
commit87892e2d0098dbd502ce98071cd68333141b9a9f (patch)
tree14deb845c1b45039fcae9b71d56bf0bbad924bf0 /lib/Command
parentfe6565c414a01f85906cd05d682aeecec4fea0a6 (diff)
Print the memory consumption of a long occ sync
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/SyncAccount.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Command/SyncAccount.php b/lib/Command/SyncAccount.php
index 8f2e8baa6..967db9ac5 100644
--- a/lib/Command/SyncAccount.php
+++ b/lib/Command/SyncAccount.php
@@ -40,6 +40,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use function memory_get_peak_usage;
+use function memory_get_usage;
class SyncAccount extends Command {
public const ARGUMENT_ACCOUNT_ID = 'account-id';
@@ -113,7 +114,8 @@ class SyncAccount extends Command {
throw $e;
}
- $output->writeln("Batch of new messages sync'ed");
+ $mbs = (int)(memory_get_usage() / 1024 / 1024);
+ $output->writeln("<info>Batch of new messages sync'ed. " . $mbs . "MB of memory in use</info>");
$this->sync($account, $force, $output);
}
}