[core] WEBJS - Add WAHA_WEBJS_PUPPETER_ARGS to test --single-process
fix #1348
This commit is contained in:
1 parent
b05cba896e
commit
9102a3d852
2 files changed
+11
No files matched your search
@@ -19,6 +19,7 @@ export class WebJSEngineConfigService {
|
||||
return {
|
||||
webVersion: webVersion,
|
||||
cacheType: this.getCacheType(),
|
||||
puppeteerArgs: this.getPuppeterArgs(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,4 +35,12 @@ export class WebJSEngineConfigService {
|
||||
|
||||
return cacheType;
|
||||
}
|
||||
|
||||
getPuppeterArgs(): string[] {
|
||||
const args = this.configService.get<string>('WAHA_WEBJS_PUPPETER_ARGS', '');
|
||||
return args
|
||||
.split(' ')
|
||||
.map((arg) => arg.trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,7 @@ import { WAJSPresenceChatStateType, WebJSPresence } from './types';
|
||||
export interface WebJSConfig {
|
||||
webVersion?: string;
|
||||
cacheType: 'local' | 'none';
|
||||
puppeteerArgs: string[];
|
||||
}
|
||||
|
||||
export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
@@ -204,6 +205,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
this.logger.info(`Using web version: '${webVersion}'`);
|
||||
}
|
||||
const args = this.getBrowserArgsForPuppeteer();
|
||||
args.push(...this.engineConfig.puppeteerArgs);
|
||||
// add at the start
|
||||
args.unshift(`--a-waha-timestamp=${new Date()}`);
|
||||
args.unshift(`--a-waha-session=${this.name}`);
|
||||
|
||||
Reference in new issue
Block a user