Files
web/apps/scandic-web/netlify/functions/hoteldata-en-background.mts
Linus Flood 310296b55f Merged in feat/warmup-cache-function (pull request #1581)
Feat/warmup cache function

* WIP

* Fix warmup for all languages

* Cleanup

* Added env flag so we can disable warmup

* Changed time to 04.00 UTC since backend updates their data at 03.00 UTC

* Add return statements

* Merge branch 'master' into feat/warmup-cache-function


Approved-by: Anton Gunnarsson
2025-03-21 09:35:36 +00:00

13 lines
387 B
TypeScript

import { Lang } from "@/constants/languages"
import type { Config, Context } from "@netlify/functions"
import { warmupHotelDataOnLang } from "../utils/hoteldata"
export default async (_request: Request, _context: Context) => {
await warmupHotelDataOnLang(Lang.en)
return new Response("Warmup success", { status: 200 })
}
export const config: Config = {
schedule: "10 4 * * *",
}