This commit is contained in:
spiduler
2020-10-26 10:42:36 +09:00
parent f638c54a68
commit 61b3e4b2bc
2 changed files with 4 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ class SeleniumBrowser {
.then(body => body.getAttribute('innerHTML'))
let htmlPromise = this.isCaptchaPage(html) ? this.resolveCaptcha(driver) : this.getHtml(driver, html, params)
html = await htmlPromise
this.pool.release(driver)
this.pool.destroy(driver)
return html
})
} else {

View File

@@ -41,8 +41,9 @@ class PoolingService {
logger.info('Driver session validation checked (id: %s)', s.getId())
return true
}).catch(err => {
this.pool.destroy(driver)
logger.debug({ message: err.message }, 'Driver session expired and destroy it')
return this.pool.destroy(driver).then(() => false)
return false
})
}