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

Number of restart events differs from the number of exec. #2213

Closed
novellat opened this issue Jul 26, 2024 · 4 comments
Closed

Number of restart events differs from the number of exec. #2213

novellat opened this issue Jul 26, 2024 · 4 comments

Comments

@novellat
Copy link

  • Versions: node@v18.18.2, darwin@23.5.0
  • nodemon -v: 3.1.4
  • Operating system/terminal environment (powershell, gitshell, etc): zsh on mac
  • Using Docker? What image: no
  • Command you ran:
const nodemon = require('nodemon');

nodemon({
  ext: 'js, jsx, ts, tsx, json, md',
  ignore: ['node_modules'],
  watch: ['./plugins'],
  exec: 'echo changed?????',
}).on('restart', (...args) => {
  console.log('CHANGE!!!!!!', args[0]);
});

Expected behaviour

expected the numbe of "changed?????" to be equal to "CHANGE!!!!!!".

Actual behaviour

But there's more restart events than the script calls.


@remy
Copy link
Owner

remy commented Jul 26, 2024 via email

@novellat
Copy link
Author

novellat commented Jul 26, 2024

The main thing is that I need to exec some relatively long running command on changes and would like to minimize the number of executions. So mostly performance impact (why run my long running command more than necessary)

@novellat
Copy link
Author

What do you mean by overlapping triggers? I only have this one nodemon script running

@novellat
Copy link
Author

Actually, feel free to close the ticket. I made a workaround around my problem - basically triggered several nodemons on different directories and then the whole logic is more straightforward and I don't need to any shenannigans like this, just a simple nodemon calls.

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