dsfsdf
This commit is contained in:
@@ -47,13 +47,15 @@ class SeleniumBrowser {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.pool.use(driver => {
|
this.pool.use(driver => {
|
||||||
if(this.pool.available == 0) browserFullCount++
|
return new Promise((resolve, reject) => {
|
||||||
if(browserFullCount > 100) {
|
if(this.pool.available == 0) this.config.browserFullCount++
|
||||||
|
if(this.config.browserFullCount > 100) {
|
||||||
this.pool.clear()
|
this.pool.clear()
|
||||||
|
this.config.browserFullCount = 0
|
||||||
|
reject(new Error('browser full count more than 100 times'))
|
||||||
|
}else {
|
||||||
|
resolve(driver)
|
||||||
}
|
}
|
||||||
return driver.getSession().then(s => driver).catch(err => {
|
|
||||||
this.pool.destroy(driver)
|
|
||||||
throw new Error('Driver session expired pool should create new instance')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user