fix(llm.gblib): Talk to data local db use fix.
This commit is contained in:
parent
36411f4243
commit
173d473166
1 changed files with 11 additions and 9 deletions
|
@ -1571,21 +1571,23 @@ export class KBService implements IGBKBService {
|
||||||
|
|
||||||
return filePath; // Return the saved file path
|
return filePath; // Return the saved file path
|
||||||
} else {
|
} else {
|
||||||
await page.goto(url, {
|
// Configure request interception before navigation
|
||||||
waitUntil: 'domcontentloaded', // Changed to only wait for DOM
|
|
||||||
timeout: 10000 // Reduced timeout to 10 seconds
|
|
||||||
});
|
|
||||||
|
|
||||||
// Stop all scripts and requests
|
|
||||||
await page.setRequestInterception(true);
|
|
||||||
// Stop all scripts and requests
|
|
||||||
await page.setRequestInterception(true);
|
await page.setRequestInterception(true);
|
||||||
page.on('request', request => {
|
page.on('request', request => {
|
||||||
if (!request.isInterceptResolutionHandled()) {
|
// Only allow document requests, block everything else
|
||||||
|
if (request.resourceType() === 'document') {
|
||||||
|
request.continue();
|
||||||
|
} else {
|
||||||
request.abort();
|
request.abort();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Navigate with strict timeout and wait for content
|
||||||
|
await page.goto(url, {
|
||||||
|
waitUntil: 'networkidle0', // Wait until network is idle
|
||||||
|
timeout: 30000 // 30 second timeout
|
||||||
|
});
|
||||||
|
|
||||||
const parsedUrl = new URL(url);
|
const parsedUrl = new URL(url);
|
||||||
|
|
||||||
// Get the last part of the URL path or default to 'index' if empty
|
// Get the last part of the URL path or default to 'index' if empty
|
||||||
|
|
Loading…
Add table
Reference in a new issue