This commit is contained in:
spiduler
2020-10-24 23:53:44 +09:00
parent 15a81262f0
commit afa299dae3

View File

@@ -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')