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.02k stars 78 forks source link

`undefined` is logged to console #252

Open hornta opened 1 month ago

hornta commented 1 month ago

I'm getting the logs suffixed by undefined for a simple job and I guess it's not intended. What might that be?

backend:dev: Worker for job "syncRequisitions" online undefined
backend:dev: Im running in cronjob
backend:dev: Worker for job "syncRequisitions" exited with code 0 undefined
import Bree from "bree";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { ENV } from "./env.ts";

const bree = new Bree({
    root: path.join(path.dirname(fileURLToPath(import.meta.url)), "jobs"),
    defaultExtension: ENV.NODE_ENV === "development" ? "ts" : "js",
    jobs: [{ name: "syncRequisitions", cron: "* * * * *" }],
});

await bree.start();
console.log("Im running in cronjob");

I'm using version 9.2.4 of bree node v22.6.0