⏱️ refactor: Retry /api/convos/gen_title every 1s for up to 20s (#7807)

This commit is contained in:
Sebastien Bruel 2025-06-11 11:12:13 +09:00 committed by GitHub
parent a57224c1d5
commit c2a18f61b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,8 +65,14 @@ router.post('/gen_title', async (req, res) => {
let title = await titleCache.get(key);
if (!title) {
await sleep(2500);
title = await titleCache.get(key);
// Retry every 1s for up to 20s
for (let i = 0; i < 20; i++) {
await sleep(1000);
title = await titleCache.get(key);
if (title) {
break;
}
}
}
if (title) {