Repository navigation
v3.2.0
- Add option to pass in multiple cron patterns to a
Clujo. TheClujowill execute on each pattern, with overlapping execution prevented in the case of an overlap. For example, only one execution will occur in the below:
const taskGraphRunner = new TaskGraph()
.addTask({
id: "task1",
execute: ({ deps, ctx }) => {
console.debug("Task 1 executing");
await sleep(100);
console.debug("Task 1 executed");
return "Task 1 result";
},
dependencies: [],
})
.build();
const clujo = new Clujo({
id: "test",
cron: {
// every 10 seconds cron pattern and every 5 seconds
patterns: ["*/10 * * * * *", "*/5 * * * * *"] ,
},
taskGraphRunner,
});
- Default to preventing overlapping executions in the single pattern, non Redis locking, single instance case. This can be changed by passing in
protect: falsein thecron.optionsof theClujoconstructor.