breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

Cannot cancel a job from inside the worker. #167

Closed AkileshRao closed 2 years ago

AkileshRao commented 2 years ago

I have been trying to stop the job from the worker using the "postMessage("cancelled")" example but it doesn't seem to work. The job keeps running at the same interval even after the message event is triggered from the worker to the parent. I've followed the steps mentioned in this section. I could be missing something very obvious but I'm not exactly sure what that is.

titanism commented 2 years ago

See our examples and tests for cancel use cases. Without seeing your source code we're unable to help further.