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

Nodemon doesn't like clustering with CoffeeScript #229

Closed
MariusStuparu opened this issue Dec 2, 2013 · 4 comments
Closed

Nodemon doesn't like clustering with CoffeeScript #229

MariusStuparu opened this issue Dec 2, 2013 · 4 comments
Labels
needs more info not enough information in issue to debug stale no activity for 2 weeks

Comments

@MariusStuparu
Copy link

Hi,

Last week I was getting ENOENT exceptions from Nodemon when trying to cluster.fork() my app. But this was happening only when running the CoffeeScript entry file, compiling it to vanilla JS is OK and running. Maybe it has something to do with my Windows PC, maybe not, I can't figure it out.

CoffeeScript module is installed, other scripts work, and it also runs fine without clustering.

Edit: seems to be in the same line with issue #214

Here's the pretty simple Compound.JS startup script:

#!/usr/bin/env node

app = module.exports = getServerInstance = (params) ->
    params = params || {}
    params.root = params.root || __dirname;
    return require('compound').createServer(params);

cluster = require('cluster')
osData = require('os')
numCPUs = osData.cpus().length

if !module.parent
  port = process.env.PORT || 3000
  host = process.env.HOST || '0.0.0.0'

  server = app();

  if cluster.isMaster
    cluster.fork() for i in [0...numCPUs] by 1

    cluster.on('exit', (worker, code, signal) ->
      console.log 'Worker %d died with code %d', worker.process.pid, code
    )
  else
      server.listen(port, host, () ->
      console.log 'Worker %d listening on %s:%d within %s environment', cluster.worker.id, host, port, server.set('env')
    );
@remy
Copy link
Owner

remy commented Dec 3, 2013

Do you mind if I mark this a closed as a dupe, and focus on the other issue that's opened?

@MariusStuparu
Copy link
Author

If it's the same issue (I see the errors are different), then it's ok to close.

@remy
Copy link
Owner

remy commented Jan 19, 2014

Is this still an issue (we're on nodemon@1.0.12 now)? I couldn't tell if there really was overlap with the referenced issue.

@stale
Copy link

stale bot commented Dec 5, 2017

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

@stale stale bot added the stale no activity for 2 weeks label Dec 5, 2017
@stale stale bot closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info not enough information in issue to debug stale no activity for 2 weeks
Projects
None yet
Development

No branches or pull requests

2 participants