noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Running CMD+ALT+B Twice executes CMD twice and looses the first #439

Closed thorleifjacobsen closed 8 years ago

thorleifjacobsen commented 8 years ago

When i run CMD+ALT+B my "gulp" command runs. Perfectly! My gulp script runs a server (listning to a port) and everythings perfect.

If i press it again it re-runs the same command, which generats an "error listning to port" since the first one already is running. Problem is that now the first one are lost in the background. To close it i need to:

ps -x | grep gulp kill -9

Then i can do a new cmd+alt+b :)

Cxarli commented 8 years ago

I guess you should stop any running builds when starting a new one, but some people might be relying on this feature.

noseglid commented 8 years ago

I'm suspecting a problem with the webserver that gulp spawns. It's likely not propagating the kill signal. For example, a simple gulpfile:

const gulp = require('gulp');

gulp.task('untz', () => {
  setInterval(() => { console.log('im running', process.pid); }, 2000);
  gulp.watch('gulpfile.js', () => {
    console.log('changed');
  });
});

And I can press cmd-alt-b over and over and it properly closes the previous command before spawning the next one. I can verify that be noticing that there's ever only one PID being output every 2 seconds.

What webserver is being spawned?

noseglid commented 8 years ago

Closing due to inactivity.