mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00:00
Prevent concurrent downloads on first-doc upload (#1267)
This commit is contained in:
parent
c2277906ad
commit
244ce2e307
1 changed files with 9 additions and 2 deletions
|
@ -107,14 +107,21 @@ class NativeEmbedder {
|
|||
);
|
||||
|
||||
let fetchResponse = await this.#fetchWithHost();
|
||||
if (fetchResponse.pipeline !== null) return fetchResponse.pipeline;
|
||||
if (fetchResponse.pipeline !== null) {
|
||||
this.modelDownloaded = true;
|
||||
return fetchResponse.pipeline;
|
||||
}
|
||||
|
||||
this.log(
|
||||
`Failed to download model from primary URL. Using fallback ${fetchResponse.retry}`
|
||||
);
|
||||
if (!!fetchResponse.retry)
|
||||
fetchResponse = await this.#fetchWithHost(fetchResponse.retry);
|
||||
if (fetchResponse.pipeline !== null) return fetchResponse.pipeline;
|
||||
if (fetchResponse.pipeline !== null) {
|
||||
this.modelDownloaded = true;
|
||||
return fetchResponse.pipeline;
|
||||
}
|
||||
|
||||
throw fetchResponse.error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue