Merged in feature/warmup (pull request #1887)

* unified warmup function

Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-04-29 06:18:14 +00:00
parent bbbd665a32
commit c1505ce50e
33 changed files with 886 additions and 185 deletions

View File

@@ -0,0 +1,28 @@
import { getCountries } from "@/server/routers/hotels/utils"
import { getServiceToken } from "@/server/tokenManager"
import type { Lang } from "@/constants/languages"
import type { WarmupFunction, WarmupResult } from "."
export const warmupCountry =
(lang: Lang): WarmupFunction =>
async (): Promise<WarmupResult> => {
try {
const serviceToken = await getServiceToken()
await getCountries({
lang: lang,
serviceToken: serviceToken.access_token,
warmup: true,
})
} catch (error) {
return {
status: "error",
error: error as Error,
}
}
return {
status: "completed",
}
}