dsfsdf
This commit is contained in:
@@ -16,7 +16,7 @@ class SeleniumBrowser {
|
||||
this.capabilities = Capabilities.chrome()
|
||||
this.sleep = m => new Promise(r => setTimeout(r, m))
|
||||
this.createPool()
|
||||
setInterval(() => this.reCreatePool(), 1000 * 60 * 3)
|
||||
// setInterval(() => this.reCreatePool(), 1000 * 60 * 3)
|
||||
}
|
||||
|
||||
reCreatePool() {
|
||||
@@ -92,7 +92,7 @@ class SeleniumBrowser {
|
||||
let uri = params.uri
|
||||
logger.info('URL %s', uri)
|
||||
if (uri.indexOf('://') > 3) {
|
||||
if (this.pool) {
|
||||
// if (this.pool) {
|
||||
return this.pool.acquire()
|
||||
.then(async driver => {
|
||||
let html = await driver.get(uri)
|
||||
@@ -103,9 +103,9 @@ class SeleniumBrowser {
|
||||
this.pool.destroy(driver)
|
||||
return html
|
||||
})
|
||||
}else {
|
||||
throw new Error('Pool is not ready')
|
||||
}
|
||||
// }else {
|
||||
// throw new Error('Pool is not ready')
|
||||
// }
|
||||
} else {
|
||||
throw new Error('Invalid URI - ' + uri)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user