mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-12 03:39:03 +08:00
fix: wait-for-selector stalling process
This commit is contained in:
parent
da1098f38d
commit
7bc70a1955
@ -1210,7 +1210,6 @@ export class PuppeteerControl extends AsyncService {
|
||||
}
|
||||
await Promise.race([Promise.allSettled([...pageScriptEvaluations, ...frameScriptEvaluations]), delayPromise])
|
||||
.catch(() => void 0);
|
||||
finalizationPromise = doFinalization();
|
||||
return stuff;
|
||||
});
|
||||
if (options.waitForSelector) {
|
||||
@ -1232,16 +1231,16 @@ export class PuppeteerControl extends AsyncService {
|
||||
});
|
||||
return p as any;
|
||||
});
|
||||
|
||||
finalizationPromise = Promise.allSettled([waitForPromise, gotoPromise]).then(doFinalization);
|
||||
} else {
|
||||
finalizationPromise = gotoPromise.then(doFinalization);
|
||||
}
|
||||
|
||||
try {
|
||||
let lastHTML = snapshot?.html;
|
||||
while (true) {
|
||||
const ckpt = [nextSnapshotDeferred.promise, gotoPromise];
|
||||
if (waitForPromise) {
|
||||
ckpt.push(waitForPromise);
|
||||
}
|
||||
const ckpt = [nextSnapshotDeferred.promise, waitForPromise ?? gotoPromise];
|
||||
|
||||
if (options.minIntervalMs) {
|
||||
ckpt.push(delay(options.minIntervalMs));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user