From 495e4bf0c4574d97787676abe458ff3e70e0cf49 Mon Sep 17 00:00:00 2001 From: spiduler Date: Fri, 23 Oct 2020 15:58:04 +0900 Subject: [PATCH] sdfds --- src/component/SeleniumBrowser.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/component/SeleniumBrowser.js b/src/component/SeleniumBrowser.js index 77a2b89..75b5ea0 100644 --- a/src/component/SeleniumBrowser.js +++ b/src/component/SeleniumBrowser.js @@ -47,13 +47,20 @@ class SeleniumBrowser { }) this.pool.use(driver => { + logger.debug({ + spare: this.pool.spareResourceCapacity, + size: this.pool.size, + available: this.pool.available, + borrowed: this.pool.borrowed, + pending: this.pool.pending + }, 'Pool info') return new Promise((resolve, reject) => { - if(this.pool.available == 0) this.config.browserFullCount++ - if(this.config.browserFullCount > 100) { + if (this.pool.available == 0) this.config.browserFullCount++ + if (this.config.browserFullCount > 100) { this.pool.clear() this.config.browserFullCount = 0 reject(new Error('browser full count more than 100 times')) - }else { + } else { resolve(driver) } })