You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foreach ($io->progressIterate($finder, $limit ?: $finder->count()) as $idx=>$dir) {
if (($io->getProgressBar()->getProgress() % $batch) === 0) {
$this->entityManager->flush();
$this->entityManager->clear();
}
}
I'd also like to configure the progressBar verbosity independently of the command verbosity. I pretty much always want to know how much memory is being used. So maybe something like creating the progressBar and setting it in $io?
I know I can do it by simply creating a progressBar and manually calling the advance and finish, but it's less code to use the built-in one.
The text was updated successfully, but these errors were encountered:
We could add some options to configure some behavior of the progress bar (the verbosity example that you mentioned is a great example) but we shouldn't make the visual design of the progress bar (or any other element of SymfonyStyle) configurable.
The idea of the SymfonyStyle is that it's a set of console design tokens with an opinionated visual design. We can change the design in newer Symfony versions to tweak/fix/improve things, but users shouldn't be allowed to change the design significantly (to do so, you can use the Console helpers directly, which give you full freedom to customize the design).
the getProgress() is something I use a lot for batch flushing, so exposing that would be great.
I think the progressBar information should be more verbose by default. That way I'd see that memory usage was going up without having to wait for an out of memory error (and then discovering that --no-debug is critical when importing a large about of data). I can't think of a situation where I'd want to hide the memory, estimated completion time, etc.
But the getProgress is data that otherwise I'd have to track in some counter (if the iterable is not indexed-based, obviously).
Uh oh!
There was an error while loading. Please reload this page.
Description
As I'm converting my console commands to Symfony 7.3, I've started to tighten them up by using SymfonyStyle's built-in progress bar.
But sometimes I want to customize it, or even just to access it.
Example
Before:
After:
I'd also like to configure the progressBar verbosity independently of the command verbosity. I pretty much always want to know how much memory is being used. So maybe something like creating the progressBar and setting it in $io?
I know I can do it by simply creating a progressBar and manually calling the advance and finish, but it's less code to use the built-in one.
The text was updated successfully, but these errors were encountered: