cron not running locally on the trigger specified

I'm using hono here but when i go to http://localhost:8787/__scheduled?cron=*****

i see the response log
Hello
[wrangler:inf] GET /__scheduled 200 OK (11ms)
╭─────────────────────────────────────────────────────


but I dont see anymore subsequent logs of the trigger again. am i doing anything wrong?


async function scheduledHandler(
    event: ScheduledEvent,
    env: Env,
    ctx: ExecutionContext,
) {
    const testMessages = [
        'Hello',
        'Goodbye',
        'Welcome',
        'Farewell',
        'Greetings',
        'I am leaving',
    ]
    ctx.waitUntil(
        (async () => {
            const randomIndex = Math.floor(Math.random() * testMessages.length)
            const randomMessage = testMessages[randomIndex]
            console.log(randomMessage)
        })(),
    )
}

export default { fetch: app.fetch.bind(app), scheduled: scheduledHandler }
Was this page helpful?