fix: use exponential backoff when checking ollama
This commit is contained in:
parent
bc9ab73951
commit
ebbc2fd55d
1 changed files with 6 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { useContext, useEffect } from "react";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { ONBOARDING_LOCAL_MODEL_TITLE } from "core/config/onboarding";
|
||||
import { withExponentialBackoff } from "core/util/withExponentialBackoff";
|
||||
|
||||
const CHECK_OLLAMA_CONNECTION_INTERVAL = 1000;
|
||||
|
||||
|
|
@ -11,9 +12,11 @@ export const useCheckOllamaModels = (
|
|||
|
||||
useEffect(() => {
|
||||
const fetchDownloadedModels = async () => {
|
||||
const result = (await ideMessenger.request("llm/listModels", {
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
})) as any;
|
||||
const result = await withExponentialBackoff(() =>
|
||||
ideMessenger.request("llm/listModels", {
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
})
|
||||
);
|
||||
|
||||
if (result.status === "success") {
|
||||
const models = result.content;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue