- Added fix
Showing
1 changed file
with
5 additions
and
3 deletions
| ... | @@ -577,15 +577,17 @@ const fetchAndFilterModels = async (client) => { | ... | @@ -577,15 +577,17 @@ const fetchAndFilterModels = async (client) => { |
| 577 | 577 | ||
| 578 | const getModels = async () => { | 578 | const getModels = async () => { |
| 579 | if (!client) { | 579 | if (!client) { |
| 580 | client = initializeRedisClient(); | 580 | client = await initializeRedisClient(); |
| 581 | await client.connect(); | ||
| 581 | 582 | ||
| 582 | try { | 583 | try { |
| 583 | await client.connect(); | ||
| 584 | filteredModels = await fetchAndFilterModels(client); | ||
| 585 | console.log('Connected to Redis successfully'); | 584 | console.log('Connected to Redis successfully'); |
| 586 | } catch (err) { | 585 | } catch (err) { |
| 587 | console.error('Error connecting to Redis:', err); | 586 | console.error('Error connecting to Redis:', err); |
| 588 | throw err; | 587 | throw err; |
| 589 | } | 588 | } |
| 590 | } | 589 | } |
| 590 | if (Object.keys(filteredModels).length === 0) { | ||
| 591 | filteredModels = await fetchAndFilterModels(client); | ||
| 592 | } | ||
| 591 | }; | 593 | }; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment