Title: How to make laterjs working on top of sailsjs
Tags: javascript;sails.js;laterjs
Question: I am trying to implement laterjs on top of sailsjs. In the bootstrap.js file, I add
sails.services.taskschedule.schedulepush();
before
and my "api/services/taskschedule.js" expose schedulepush() , I require 'later' in this file.
The problem is:
var schedule = later.parse.text('every 5 min');
var lt = later.setInterval(somfunction, schedule) ;
inside the schedulepush() is executed immediately and only once while I suppose it should run every 5 minutes.
Also,
console.log(lt);
is undefined.
What could the problem be? How can it be fixed?
Comment: The culprit is likely with the `someFunction` variable/callback--the rest appears fine

Comment: seems like a laterjs problem. I tried it with node-scheduler and it's working fine. I guess I'll use node-scheduler instead.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:02/10/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><sails.js><laterjs>', 'Title': 'How to make laterjs working on top of sailsjs', 'ViewCount': 32, 'id': 35318853, 'user_AboutMe': '', 'user_AccountId': 3071066.0, 'user_DisplayName': 'L4reds', 'user_Reputation': 402.0, 'user_Views': 42.0, 'user_id': 2601719.0}}