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

Server code run twice on startup #9

Open
nelisbijl opened this issue Apr 24, 2015 · 4 comments
Open

Server code run twice on startup #9

nelisbijl opened this issue Apr 24, 2015 · 4 comments

Comments

@nelisbijl
Copy link

Not sure if it only concerns the server code

Reproduce:

  • create brand new meteor application
  • Add a single JS file in the server folder that does a console.log
  • run meteor
  • log line is printed once
  • stop meteor
  • add differential:workers
  • run meteor
  • log line printed twice

My output (log msg: 'server/test.js'):
=> Started proxy.
=> Started MongoDB.
I20150424-08:36:12.203(2)? server/test.js
I20150424-08:36:12.205(2)? MASTER: Requeued 0 jobs.
=> Started your app.

=> App running at: http://localhost:3000/
I20150424-08:36:12.841(2)? server/test.js
I20150424-08:36:12.847(2)? PID 24372: Started 1 monq workers.

@Nevtep
Copy link

Nevtep commented Dec 17, 2015

Same happens to me, this is my log:

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/
I20151217-15:55:56.453(-3)? You now have an instance of the bitfinex API object available
I20151217-15:55:56.454(-3)? MASTER: Requeued 0 jobs.
I20151217-15:55:56.454(-3)? Initialize APIs
I20151217-15:55:56.994(-3)? WebSocket Client Connected
I20151217-15:55:57.148(-3)? You now have an instance of the bitfinex API object available
I20151217-15:55:57.161(-3)? PID 7986: Started 1 monq workers.
I20151217-15:55:57.174(-3)? Initialize APIs
I20151217-15:55:58.006(-3)? WebSocket Client Connected

@lusilva
Copy link

lusilva commented Mar 4, 2016

I'm also experiencing this, is this project still active?

@elie222
Copy link

elie222 commented Mar 13, 2016

same issue here

@noahadler
Copy link

you can solve this by adding an extra check to make sure the process isn't a worker. For instance, instead of:
Meteor.startup(function() { if (Meteor.isServer) { /*...*/ } });
try:
Meteor.startup(function() { if (Meteor.isServer && Npm.require('cluster').isMaster) { /*...*/ } });

@schnie schnie removed their assignment Jan 26, 2020
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

6 participants