git actions v2

This commit is contained in:
Davidson Gomes
2024-06-09 14:49:09 -03:00
parent 71a97e047a
commit 14e7a68c32
7 changed files with 11 additions and 76 deletions

View File

@@ -1,7 +1,6 @@
import { Contact, Message } from '@prisma/client';
import { WASocket } from '@whiskeysockets/baileys';
import axios from 'axios';
import { execSync } from 'child_process';
import { isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2';
import { join } from 'path';
@@ -10,9 +9,7 @@ import { v4 } from 'uuid';
import {
Auth,
Chatwoot,
CleanStoreConf,
ConfigService,
Database,
HttpServer,
Log,
Rabbitmq,
@@ -986,26 +983,6 @@ export class ChannelStartupService {
}
}
public cleanStore() {
const cleanStore = this.configService.get<CleanStoreConf>('CLEAN_STORE');
const database = this.configService.get<Database>('DATABASE');
if (cleanStore?.CLEANING_INTERVAL && !database.ENABLED) {
setInterval(() => {
try {
for (const [key, value] of Object.entries(cleanStore)) {
if (value === true) {
execSync(
`rm -rf ${join(this.storePath, key.toLowerCase().replace('_', '-'), this.instance.name)}/*.json`,
);
}
}
} catch (error) {
this.logger.error(error);
}
}, (cleanStore?.CLEANING_INTERVAL ?? 3600) * 1000);
}
}
// Check if the number is MX or AR
public formatMXOrARNumber(jid: string): string {
const countryCode = jid.substring(0, 2);

View File

@@ -139,7 +139,6 @@ export class BaileysStartupService extends ChannelStartupService {
private readonly providerFiles: ProviderFiles,
) {
super(configService, eventEmitter, prismaRepository, chatwootCache);
this.cleanStore();
this.instance.qrcode = { count: 0 };
this.recoveringMessages();
this.cronForceUpdateGroupMetadataCache();

View File

@@ -39,7 +39,6 @@ export class BusinessStartupService extends ChannelStartupService {
private readonly providerFiles: ProviderFiles,
) {
super(configService, eventEmitter, prismaRepository, chatwootCache);
this.cleanStore();
}
public stateConnection: wa.StateConnection = { state: 'open' };