I am trying to implement laterjs on top of sailsjs. in the bootstrap.js file, I add
sails.services.taskschedule.schedulepush();
before
cb();
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? and How can it be fixed?