Extend ttl to 12 hours

This commit is contained in:
Hongbo Wu 2022-09-22 11:20:11 +08:00
parent f4f99a30b2
commit 279dbf2049

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 1 hour
// save audio data to cache for 12 hours
await redisClient.set(
cacheKey,
JSON.stringify({ audioDataString, speechMarks }),
{
EX: 3600, // in seconds
EX: 3600 * 12, // in seconds
NX: true,
}
)