Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
Description: After discovering that class functions cannot be used for the scheduler jobs, I created a top-level function and am attempting to access the workerData to run the correct Collector (see #245).
[worker eval]:3
console.log(worker_threads_1.workerData);
^
ReferenceError: worker_threads_1 is not defined
at runCollectorJob ([worker eval]:3:17)
at [worker eval]:9:3
at runScriptInThisContext (node:internal/vm:143:10)
at node:internal/process/execution:100:14
at [worker eval]-wrapper:6:24
at runScript (node:internal/process/execution:83:62)
at evalScript (node:internal/process/execution:114:10)
at MessagePort.<anonymous> (node:internal/main/worker_thread:166:9)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
Code to reproduce
I can create a sample reproduction of the problem if needed.
Checklist
[x] I have searched through GitHub issues for similar issues.
[x] I have completely read through the README and documentation.
[x] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
Describe the bug
Node.js version: 18
OS version: Ubuntu (Docker)
Description: After discovering that class functions cannot be used for the scheduler jobs, I created a top-level function and am attempting to access the
workerData
to run the correct Collector (see #245).Code to reproduce
I can create a sample reproduction of the problem if needed.
Checklist