mirror of https://github.com/FlowiseAI/Flowise.git
* FIX #2617 Big sites scan error * FIX #2617 Big sites scan error - review fix --------- Co-authored-by: Ahmed Osman <ahmed.osman@evolpe.pl>pull/2765/head
parent
b1e38783e4
commit
90558ca688
|
|
@ -131,7 +131,11 @@ class Cheerio_DocumentLoaders implements INode {
|
|||
|
||||
async function cheerioLoader(url: string): Promise<any> {
|
||||
try {
|
||||
let docs = []
|
||||
let docs: IDocument[] = []
|
||||
if (url.endsWith('.pdf')) {
|
||||
if (process.env.DEBUG === 'true') options.logger.info(`CheerioWebBaseLoader does not support PDF files: ${url}`)
|
||||
return docs
|
||||
}
|
||||
const loader = new CheerioWebBaseLoader(url, params)
|
||||
if (textSplitter) {
|
||||
docs = await loader.loadAndSplit(textSplitter)
|
||||
|
|
@ -141,6 +145,7 @@ class Cheerio_DocumentLoaders implements INode {
|
|||
return docs
|
||||
} catch (err) {
|
||||
if (process.env.DEBUG === 'true') options.logger.error(`error in CheerioWebBaseLoader: ${err.message}, on page: ${url}`)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue