diff --git a/src/core/abc/manager.abc.ts b/src/core/abc/manager.abc.ts index 6ab5b7d9..bcb07f0a 100644 --- a/src/core/abc/manager.abc.ts +++ b/src/core/abc/manager.abc.ts @@ -2,6 +2,7 @@ import { BeforeApplicationShutdown, UnprocessableEntityException, } from '@nestjs/common'; +import { WhatsappConfigService } from '@waha/config.service'; import { ISessionMeRepository } from '@waha/core/storage/ISessionMeRepository'; import { WAHAWebhook } from '@waha/structures/webhooks.dto'; import { waitUntil } from '@waha/utils/promiseTimeout'; @@ -39,7 +40,10 @@ export abstract class SessionManager implements BeforeApplicationShutdown { WAIT_STATUS_INTERVAL = 500; WAIT_STATUS_TIMEOUT = 5_000; - protected constructor(protected log: PinoLogger) { + protected constructor( + protected config: WhatsappConfigService, + protected log: PinoLogger, + ) { this.lock = new AsyncLock({ maxPending: Infinity }); this.log.setContext(SessionManager.name); } diff --git a/src/core/manager.core.ts b/src/core/manager.core.ts index 6bef84d3..4e0bc6df 100644 --- a/src/core/manager.core.ts +++ b/src/core/manager.core.ts @@ -64,12 +64,12 @@ export class SessionManagerCore extends SessionManager { protected readonly EngineClass: typeof WhatsappSession; constructor( - private config: WhatsappConfigService, + config: WhatsappConfigService, private engineConfigService: EngineConfigService, log: PinoLogger, private mediaStorageFactory: MediaStorageFactory, ) { - super(log); + super(config, log); this.events = new EventEmitter(); this.session = DefaultSessionStatus.STOPPED; this.sessionConfig = null;