Merged in feature/warmup (pull request #1887)
* unified warmup function Approved-by: Linus Flood
This commit is contained in:
20
apps/scandic-web/services/warmup/warmupKeys.ts
Normal file
20
apps/scandic-web/services/warmup/warmupKeys.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
const langs = Object.keys(Lang) as Lang[]
|
||||
|
||||
/*
|
||||
* Keys for warmup functions, the order of the keys is the order in which they will be executed
|
||||
*/
|
||||
export const warmupKeys = [
|
||||
...langs.map((lang) => `countries_${lang}` as const),
|
||||
"hotelsByCountry",
|
||||
...langs.map((lang) => `hotelData_${lang}` as const),
|
||||
] as const
|
||||
|
||||
export type WarmupFunctionsKey = (typeof warmupKeys)[number]
|
||||
|
||||
export function isWarmupKey(key: unknown): key is WarmupFunctionsKey {
|
||||
return (
|
||||
typeof key === "string" && warmupKeys.includes(key as WarmupFunctionsKey)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user