mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
⏱️ refactor: Retry /api/convos/gen_title every 1s for up to 20s (#7807)
This commit is contained in:
parent
a57224c1d5
commit
c2a18f61b4
1 changed files with 8 additions and 2 deletions
|
|
@ -65,8 +65,14 @@ router.post('/gen_title', async (req, res) => {
|
||||||
let title = await titleCache.get(key);
|
let title = await titleCache.get(key);
|
||||||
|
|
||||||
if (!title) {
|
if (!title) {
|
||||||
await sleep(2500);
|
// Retry every 1s for up to 20s
|
||||||
|
for (let i = 0; i < 20; i++) {
|
||||||
|
await sleep(1000);
|
||||||
title = await titleCache.get(key);
|
title = await titleCache.get(key);
|
||||||
|
if (title) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue