mirror of
https://github.com/langgenius/dify.git
synced 2026-09-05 00:31:19 +08:00
fix(knowledge_fs): refactor crawl page import logic to handle missing pages
This commit is contained in:
parent
6c47ee52eb
commit
cbecb64fef
@ -847,10 +847,7 @@ describe("source-product workflow provider imports", () => {
|
||||
},
|
||||
inventory: [],
|
||||
run: providerRun(source.id, "crawl-import", {
|
||||
selectedSourceUrls: [
|
||||
"https://example.test/selected",
|
||||
"https://example.test/missing",
|
||||
],
|
||||
selectedSourceUrls: ["https://example.test/selected", "https://example.test/missing"],
|
||||
}),
|
||||
source,
|
||||
websiteCrawl: {
|
||||
|
||||
@ -793,12 +793,14 @@ async function processSelectedCrawlImport(
|
||||
state: "importing",
|
||||
}),
|
||||
);
|
||||
await importCrawlPages(
|
||||
input,
|
||||
execution,
|
||||
source,
|
||||
[...requestedUrls].map((sourceUrl) => matched.get(sourceUrl)!),
|
||||
);
|
||||
const selectedPages = [...requestedUrls].map((sourceUrl) => {
|
||||
const page = matched.get(sourceUrl);
|
||||
if (!page) {
|
||||
throw runtimeError("SOURCE_CRAWL_PAGE_NOT_FOUND", "Selected crawl page is unavailable");
|
||||
}
|
||||
return page;
|
||||
});
|
||||
await importCrawlPages(input, execution, source, selectedPages);
|
||||
}
|
||||
|
||||
async function importCrawlPages(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user