dsfd
This commit is contained in:
@@ -15,6 +15,18 @@ class SeleniumBrowser {
|
||||
}
|
||||
this.capabilities = Capabilities.chrome()
|
||||
this.sleep = m => new Promise(r => setTimeout(r, m))
|
||||
setInterval(this.createPool, 1000 * 60)
|
||||
}
|
||||
|
||||
reCreatePool() {
|
||||
this.pool.drain().then(() => {
|
||||
return this.pool.clear()
|
||||
}).then(() => {
|
||||
this.createPool()
|
||||
})
|
||||
}
|
||||
|
||||
createPool() {
|
||||
this.pool = pool.createPool({
|
||||
create: () => {
|
||||
logger.info('Create new driver instance')
|
||||
@@ -31,7 +43,7 @@ class SeleniumBrowser {
|
||||
pending: this.pool.pending
|
||||
}, 'Pool info')
|
||||
}).catch(err => {
|
||||
logger.debug({message: err.message}, 'Quitting error')
|
||||
logger.debug({ message: err.message }, 'Quitting error')
|
||||
this.pool.release(driver)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user