mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
chore: cache decreased
This commit is contained in:
parent
eec29ef9dc
commit
a3e6646ad7
@ -446,7 +446,7 @@ export const get = {
|
|||||||
const json = JSON.parse(k)
|
const json = JSON.parse(k)
|
||||||
return await getBotList('CATEGORY', json.page, json.category)
|
return await getBotList('CATEGORY', json.page, json.category)
|
||||||
}))).map(row => serialize(row))
|
}))).map(row => serialize(row))
|
||||||
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 3000000 }) }),
|
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 1000000 }) }),
|
||||||
search: new DataLoader(
|
search: new DataLoader(
|
||||||
async (key: string[]) =>
|
async (key: string[]) =>
|
||||||
(await Promise.all(key.map(async (k: string) => {
|
(await Promise.all(key.map(async (k: string) => {
|
||||||
@ -454,11 +454,11 @@ export const get = {
|
|||||||
const res = await getBotList('SEARCH', json.page, json.query)
|
const res = await getBotList('SEARCH', json.page, json.query)
|
||||||
return { ...res, totalPage: Number(res.totalPage), currentPage: Number(res.currentPage) }
|
return { ...res, totalPage: Number(res.totalPage), currentPage: Number(res.currentPage) }
|
||||||
}))).map(row => serialize(row))
|
}))).map(row => serialize(row))
|
||||||
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 3000000 }) }),
|
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 1000000 }) }),
|
||||||
votes: new DataLoader(
|
votes: new DataLoader(
|
||||||
async (pages: number[]) =>
|
async (pages: number[]) =>
|
||||||
(await Promise.all(pages.map(async (page: number) => await getBotList('VOTE', page)))).map(row => serialize(row))
|
(await Promise.all(pages.map(async (page: number) => await getBotList('VOTE', page)))).map(row => serialize(row))
|
||||||
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 3000000 }) }),
|
, { cacheMap: new TLRU({ maxStoreSize: 50, maxAgeMs: 1000000 }) }),
|
||||||
new: new DataLoader(
|
new: new DataLoader(
|
||||||
async (pages: number[]) =>
|
async (pages: number[]) =>
|
||||||
(await Promise.all(pages.map(async (page: number) => await getBotList('NEW', page)))).map(row => serialize(row))
|
(await Promise.all(pages.map(async (page: number) => await getBotList('NEW', page)))).map(row => serialize(row))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user