sdfds
This commit is contained in:
@@ -47,13 +47,20 @@ class SeleniumBrowser {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.pool.use(driver => {
|
this.pool.use(driver => {
|
||||||
|
logger.debug({
|
||||||
|
spare: this.pool.spareResourceCapacity,
|
||||||
|
size: this.pool.size,
|
||||||
|
available: this.pool.available,
|
||||||
|
borrowed: this.pool.borrowed,
|
||||||
|
pending: this.pool.pending
|
||||||
|
}, 'Pool info')
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if(this.pool.available == 0) this.config.browserFullCount++
|
if (this.pool.available == 0) this.config.browserFullCount++
|
||||||
if(this.config.browserFullCount > 100) {
|
if (this.config.browserFullCount > 100) {
|
||||||
this.pool.clear()
|
this.pool.clear()
|
||||||
this.config.browserFullCount = 0
|
this.config.browserFullCount = 0
|
||||||
reject(new Error('browser full count more than 100 times'))
|
reject(new Error('browser full count more than 100 times'))
|
||||||
}else {
|
} else {
|
||||||
resolve(driver)
|
resolve(driver)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user