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

[fix] Missing await on 'start' function. #218

Open
3 tasks done
jmtt89 opened this issue May 24, 2023 · 0 comments
Open
3 tasks done

[fix] Missing await on 'start' function. #218

jmtt89 opened this issue May 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jmtt89
Copy link

jmtt89 commented May 24, 2023

Describe the bug

Node.js version: 18.16

OS version: Win11 (WSL)

Description:

The bug is on the start function, when calling start on already started project, the app will fail and the error can't be cached by try /catch statement, that is because the this.start(job.name) no are waiting...

a good enough solution maybe as call await Promise.all([...]) or just add a await inside the for

 async start(name) {
    ...
    for (const job of this.config.jobs) {
      this.start(job.name);
    }
  }

Code to reproduce

(async () => {
  ....
  await bree.add('boop');
  await bree.start()
  ....
  await bree.add('foo');
  try {
    await bree.start()
  catch (err) {
     // Never call this catch but 
   }
})();

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@jmtt89 jmtt89 added the bug Something isn't working label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant