import { performWarmup } from "./warmup-background.mjs"

import type { Config, Context } from "@netlify/functions"

async function WarmupHandler(_request: Request, context: Context) {
  console.log("[WARMUP] Starting scheduled warmup")
  await performWarmup(context)
  console.log("[WARMUP] Scheduled warmup completed")
}

export default WarmupHandler
export const config: Config = {
  schedule: "0 4 * * *",
}
