new(all): Paralel bot loading.
This commit is contained in:
parent
9fa736918f
commit
907a47cc68
2 changed files with 10 additions and 4 deletions
|
@ -173,15 +173,14 @@ export class GBMinService {
|
|||
// Calls mountBot event to all bots.
|
||||
|
||||
this.bar1 = new cliProgress.SingleBar({
|
||||
format: '[{bar}] Loading {botId} ({value}/{total})...', barsize: 30,
|
||||
format: '[{bar}] ({value}/{total}) Loading {botId} ...', barsize: 40,
|
||||
forceRedraw: true
|
||||
}, cliProgress.Presets.rect);
|
||||
let i = 1;
|
||||
GBLog.info('Starting bot instance load phase...');
|
||||
this.bar1.start(instances.length, i, { botId: "Boot" });
|
||||
|
||||
const throttledPromiseAll = async (promises) => {
|
||||
const MAX_IN_PROCESS = 15;
|
||||
const MAX_IN_PROCESS = 20;
|
||||
const results = new Array(promises.length);
|
||||
|
||||
async function doBlock(startIndex) {
|
||||
|
|
|
@ -144,8 +144,15 @@ export class WhatsappDirectLine extends GBService {
|
|||
|
||||
const createClient = async (browserWSEndpoint) => {
|
||||
let puppeteer: any = {
|
||||
headless: false, args: [
|
||||
headless: true, args: [
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-accelerated-2d-canvas',
|
||||
'--no-first-run',
|
||||
'--no-zygote',
|
||||
'--single-process', // <- this one doesn't works in Windows
|
||||
'--disable-gpu',
|
||||
'--disable-infobars',
|
||||
'--disable-features=site-per-process',
|
||||
`--user-data-dir=${localName}`]
|
||||
|
|
Loading…
Add table
Reference in a new issue