Scheduled jobs

From Dreamtsoft Wiki
Jump to: navigation, search

Scheduled Jobs

Scheduled jobs allow you to schedule code to run at specific times. There are 2 main components to a scheduled job, the job definition and the job handler.

  • Job definition - Sets the schedule to run the job handler.
  • Job handler - Defines the code to be run.


S jobs1.jpg


Job Handler Example

var AJobHandler = require("scheduler/classes/AJobHandler");

var YourScheduledJob = AJobHandler.create({
   doJob: function(payload) {
		//Insert scheduled job code here
		//var v = new FRecord('your_test_bucket');
		//v.your_slot = "FooBar";
		//v.insert();
   },

   className: "YourScheduledJob"
});

module.exports = YourScheduledJob;