mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-18 20:55:58 +08:00
fix
This commit is contained in:
parent
dc8781d20c
commit
d84ef707df
@ -171,6 +171,7 @@ export class GoogleSERP extends AsyncService {
|
||||
|
||||
url.searchParams.set('async', getMagicAsyncParam(query.start, ctx.magicId));
|
||||
|
||||
const t0 = performance.now();
|
||||
const sideLoaded = await this.sideLoadWithAllocatedProxy(url, {
|
||||
...opts,
|
||||
allocProxy: opts?.allocProxy || (this.nativeIPHealthy ? 'none' : 'auto'),
|
||||
@ -180,6 +181,7 @@ export class GoogleSERP extends AsyncService {
|
||||
|
||||
return Promise.reject(err);
|
||||
});
|
||||
const dt = performance.now() - t0;
|
||||
|
||||
if ('proxy' in sideLoaded) {
|
||||
ctx.proxyUrl = sideLoaded.proxy.href;
|
||||
@ -187,7 +189,11 @@ export class GoogleSERP extends AsyncService {
|
||||
}
|
||||
|
||||
if (sideLoaded.status === 200) {
|
||||
this.contextPool.release(ctx);
|
||||
if (dt < 1_700) {
|
||||
this.contextPool.release(ctx);
|
||||
} else {
|
||||
this.contextPool.destroy(ctx);
|
||||
}
|
||||
} else {
|
||||
if (this.nativeIPHealthy && this.asyncLocalContext.ctx.ctxIsNew) {
|
||||
this.nativeIPBlocked();
|
||||
|
Loading…
x
Reference in New Issue
Block a user