Report this

What is the reason for this report?

A process in nodejs automatically repeat for infinite time

Posted on May 15, 2017

When i start a index.js file through command line

node index.js

It starts but, it print the result multiple time even a single user is connected. Result is:-

7544816137 is connected
gX8dcI27WNRNww6QAAAd
gX8dcI27WNRNww6QAAAd
connected as id 277
7544816137 is connected
gX8dcI27WNRNww6QAAAd
gX8dcI27WNRNww6QAAAd
connected as id 277

This happens on digital ocean server only, It doesn’t happen on localserver. Please tell me a way to resolve this problem



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

For anyone who comes across this in the future, it sounds like that there are different people connecting to the server which might result in the behaviour that you are describing.

To be able to advise further, it is best to share the code snippet so I could run it on my end as well.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.