W
W
WAYNEDEV2020-04-14 13:01:48
Node.js
WAYNEDEV, 2020-04-14 13:01:48

How can node.js code be improved/optimized?

Hello! Need help optimizing node.js code. Now it's pretty "terrible", I would like to know the advice of experts where it can be improved.

Link to the code

In general, I understand that it is most wrong to make 4 requests to the database + process it all in one second. Can you give any advice on how to fix this? because when adding new data, everything starts to lag, which is not surprising. It is necessary to do an action every second, but maybe there is another option besides cron? setTimeout makes everything crazy.
I would be grateful for any advice and help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question