New method of saving sessions to a file using worker

This commit is contained in:
Davidson Gomes
2024-06-01 09:54:56 -03:00
parent f7c9541f5e
commit 696261d749
12 changed files with 349 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ import {
WebsocketModel,
} from './models';
import { LabelModel } from './models/label.model';
import { ProviderFiles } from './provider/sessions';
import { AuthRepository } from './repository/auth.repository';
import { ChatRepository } from './repository/chat.repository';
import { ContactRepository } from './repository/contact.repository';
@@ -109,6 +110,7 @@ export const repository = new RepositoryBroker(
export const cache = new CacheService(new CacheEngine(configService, 'instance').getEngine());
const chatwootCache = new CacheService(new CacheEngine(configService, ChatwootService.name).getEngine());
const messagesLostCache = new CacheService(new CacheEngine(configService, 'baileys').getEngine());
const providerFiles = new ProviderFiles(configService);
export const waMonitor = new WAMonitoringService(
eventEmitter,
@@ -117,6 +119,7 @@ export const waMonitor = new WAMonitoringService(
cache,
chatwootCache,
messagesLostCache,
providerFiles,
);
const authService = new AuthService(configService, waMonitor, repository);
@@ -168,6 +171,7 @@ export const instanceController = new InstanceController(
cache,
chatwootCache,
messagesLostCache,
providerFiles,
);
export const sendMessageController = new SendMessageController(waMonitor);
export const chatController = new ChatController(waMonitor);