Skip to content

Commit

Permalink
Avoid pool args constant changes
Browse files Browse the repository at this point in the history
Endpoint connections were pushing the token param once for each factory
create call.
  • Loading branch information
pedrobmarin committed Mar 3, 2021
1 parent d3a3be1 commit b2cccb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const conf = require('./conf');

const { browser, bot, data } = conf.config;

const args = [
const ARGS = [
`--lang=${browser.lang}`,
`--disable-dev-shm-usage`,
`--no-user-gesture-required`,
Expand All @@ -15,6 +15,7 @@ const args = [
const factory = {
create: async () => {
const { headless, path, endpoint, token } = browser;
const args = ARGS.slice();
if (endpoint) {
if (token) args.push(`token=${token}`);
return await puppeteer.connect({
Expand Down

0 comments on commit b2cccb5

Please sign in to comment.