Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just stops after a while and ends the process #25

Open
darlenya opened this issue Feb 20, 2018 · 2 comments
Open

Just stops after a while and ends the process #25

darlenya opened this issue Feb 20, 2018 · 2 comments

Comments

@darlenya
Copy link

darlenya commented Feb 20, 2018

Hi I used it under Mac OS 10.13.3 with node v9.5.0
When running it with a bigger amount of cycles it crashes after a while.

This example code shows the problem:

const ProgressBar = require('ascii-progress')

const TOTAL_TESTCASE = 251
const TOTAL_STEPS = 628

const barTestcase = new ProgressBar({
    schema:
        'Test cases: [:bar.yellow] :current/:total :percent :elapseds :etas <:name>',
    total: TOTAL_TESTCASE,
    clear: false,
})

const barStep = new ProgressBar({
    schema:
        'Steps:      [:bar.green] :current/:total :percent :elapseds :etas <:name>',
    total: TOTAL_STEPS,
    clear: false,
})

// make the bars Visible in the right order
barTestcase.tick()
barTestcase.tick(-1)

barStep.tick()
barStep.tick(-1)


for(let stepCount =0; stepCount<TOTAL_STEPS; stepCount++){
    barStep.tick()
    for(let tcCount =0; tcCount<TOTAL_TESTCASE; tcCount++){
        barTestcase.tick()
    }
    barTestcase.tick(-TOTAL_TESTCASE)
}
@vrockai
Copy link

vrockai commented Jun 13, 2018

I just spent a day figuring this out. The issue is in the [email protected] which is used in the latest released version of [email protected]. The ([email protected]) function opens a new terminal with each call, resulting in a new file descriptor and it doesn't close it = thus the "too many open files" error (I believe you would get it after waiting some time after your app freezes). The latest version [email protected] has this fixed.

@bubkoo can you please let us know when is the next release of ascii-progress planned? I can see you have already fixed the get-cursor-position version in the package.json, it's just not released. Thanks for any info!

@vrockai
Copy link

vrockai commented Jun 13, 2018

FTW, I've just found the package is release under a new name node-progress-bars, @darlenya if you use this package instead of ascii-progress I believe your error would be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants