Set TTL to 24 hours

This commit is contained in:
Hongbo Wu 2022-09-22 11:51:56 +08:00
parent b9e2fc465c
commit 2150ce2ce8

View file

@ -210,12 +210,12 @@ export const textToSpeechStreamingHandler = Sentry.GCPFunction.wrapHttpFunction(
return res.status(500).send({ errorCode: 'SYNTHESIZER_ERROR' })
}
const audioDataString = audioData.toString('hex')
// save audio data to cache for 12 hours
// save audio data to cache for 24 hours for mainly the newsletters
await redisClient.set(
cacheKey,
JSON.stringify({ audioDataString, speechMarks }),
{
EX: 3600 * 12, // in seconds
EX: 3600 * 24, // in seconds
NX: true,
}
)