O
O
olezhenka2017-06-13 18:20:12
Node.js
olezhenka, 2017-06-13 18:20:12

How to make functions execute on a node.js timer?

I need to do something like a reminder to run a script in node.js at a certain time.
setTimeout will not work, because you can't set a large amount of time there.
there are cron modules, but if you suddenly restart the script, then all crons will disappear.
How can it be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2017-06-13
@RidgeA

linux crontab if on linux. Otherwise, you need to look for what can pull the script on the timer with a sufficient degree of reliability.

A
Alexey Sergey, 2017-06-13
@dev_random

сделать функцию, которая может определить настал ли час Ч и дергать ее раз в минуту.
а вообще, как указал RidgeA, возможно стоит рассмотреть системные планировщики для описанной задачи.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question