npkgz / cli-progress

:hourglass: easy to use progress-bar for command-line/terminal applications
https://www.npmjs.com/package/cli-progress
MIT License
1.11k stars 84 forks source link

How to exit my process when the bar is at 100%? #146

Closed JemiloII closed 1 year ago

JemiloII commented 1 year ago

So I have it to were I call progress.stop(), yet the application says alive and continues to run. There is nothing left for the application to do, but it is still alive. How do I have cli-progress exit because calling stop() isn't working?

AndiDittrich commented 1 year ago

could you provide a minimal example please how to reproduce the issue. is this related to single or multibar mode mode (multibar needs to be stopped globally, not per instance)

https://github.com/npkgz/cli-progress#multi-bar-mode

JemiloII commented 1 year ago

It was with the single bar, but I figured it out after making an example. The example does what is expected so looked back at the code to find that in one instance, a db connection wasn't closing, and in another, the puppeteer process itself wasn't exiting. Sorry.

olafurw commented 1 year ago

If someone else is looking for an issue similar to this, also note that if you create a MultiBar you also need to call .stop() on it, even if you've stopped all of the "child" progress bars.