Merged in feature/warmup (pull request #1887)
* unified warmup function Approved-by: Linus Flood
This commit is contained in:
@@ -130,9 +130,11 @@ export async function getCity({
|
||||
export async function getCountries({
|
||||
lang,
|
||||
serviceToken,
|
||||
warmup = false,
|
||||
}: {
|
||||
lang: Lang
|
||||
serviceToken: string
|
||||
warmup?: boolean
|
||||
}) {
|
||||
const cacheClient = await getCacheClient()
|
||||
return await cacheClient.cacheOrGet(
|
||||
@@ -166,7 +168,10 @@ export async function getCountries({
|
||||
|
||||
return countries.data
|
||||
},
|
||||
"1d"
|
||||
"1d",
|
||||
{
|
||||
cacheStrategy: warmup ? "fetch-then-cache" : "cache-first",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user