Setu-TS
    Preparing search index...

    Function createScheduledHandler

    • Builds the handler an application exports as scheduled.

      Takes the WorkersCron directly rather than the application, unlike createQueueHandler. That asymmetry follows from a decision rather than an oversight: WorkersCron deliberately does not claim CAPABILITIES.SCHEDULER (see its module doc), so it is not in the registry to resolve — and it needs neither an id source nor a clock, so the application can construct it directly.

      Parameters

      Returns ScheduledHandler

      The handler to assign to the Worker's scheduled export

      const cron = new WorkersCron({ logger });
      cron.on('*/5 * * * *', () => sweepExpiredSessions(app));

      export default { fetch: app.fetch, scheduled: createScheduledHandler(cron) };

      0.2.0