Can a cron job run every 'x' seconds

后端 未结 2 797
我寻月下人不归
我寻月下人不归 2021-02-14 08:22

I have a cron job setup, with the minimum value of 60 seconds, and I want the program to be able to run at second intervals i.e. whatever I set it as 60 seconds onwards.

2条回答
  •  悲&欢浪女
    2021-02-14 08:27

    cron.schedule('*/' + test + '0,x * * * * *', function () {
       console.log('running a task every x seconds');
    });
    

    this will run every x seconds.

提交回复
热议问题