API hosting

Deploy a Bun + Hono cron job on DenkOps

Bun has no built-in cron primitive, but it doesn't need one when the process itself never stops: a plain setInterval timer started next to your Hono app is enough, because a DenkOps slot keeps that timer alive indefinitely instead of tearing it down between invocations like a serverless function would.

import { Hono } from "hono";

const app = new Hono();

function nightlyJob() {
  console.log("running nightly report", new Date().toISOString());
}

// fire once a day (86_400_000 ms) from inside the long-lived process
setInterval(nightlyJob, 24 * 60 * 60 * 1000);

app.get("/health", (c) => c.json({ ok: true }));

export default { port: 3000, fetch: app.fetch };

Deploy it: install the plugin, say "deploy on DenkOps", and get a live SSL URL.

Start on DenkOps →

FAQ

Can Bun run scheduled jobs without an external cron service on DenkOps?

Yes. Because the slot keeps the Bun process running continuously, a plain setInterval timer reliably fires on schedule with no separate infrastructure.

Does the timer survive a redeploy on DenkOps?

The interval itself restarts with a fresh process on redeploy, same as any in-memory timer, pair it with /persist if the job needs to remember its last run time.

← Deploy AI agents · API hosting