fix slop cache
This commit is contained in:
parent
9f760718f0
commit
ae502f4c6c
|
|
@ -90,7 +90,7 @@ async function parseSlop(id: string, title: string, description: string, channel
|
||||||
if (channelBlacklist.includes(channelId)) return true;
|
if (channelBlacklist.includes(channelId)) return true;
|
||||||
|
|
||||||
const cachedSlop = await redis.get(`slop:${id}`)
|
const cachedSlop = await redis.get(`slop:${id}`)
|
||||||
if (cachedSlop) return Boolean(cachedSlop)
|
if (cachedSlop) return cachedSlop == 'true' ? true : false
|
||||||
|
|
||||||
const { is_slop, reasoning } = await analyseSlop(id , title, description)
|
const { is_slop, reasoning } = await analyseSlop(id , title, description)
|
||||||
if (reasoning != 'failed to parse') await redis.set(`slop:${id}`, is_slop.toString(), 'EX', 60 * 60 * 24 * 7)
|
if (reasoning != 'failed to parse') await redis.set(`slop:${id}`, is_slop.toString(), 'EX', 60 * 60 * 24 * 7)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue