Mref
Bun

method

CronJob.ref

Keep the process alive while this job is scheduled (default).

Referenced types

interface CronJob

A handle to an in-process cron job returned by Bun.cron when called with a callback.

const job = Bun.cron("0 * * * *", async () => {
  await cleanupTempFiles();
});
// Later:
job.stop();
  • readonly cron: string

    The cron expression string.

  • Keep the process alive while this job is scheduled (default).

  • Cancel this cron job. The callback will not fire again.

  • Allow the process to exit even while this job is scheduled.