mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-18 19:32:21 -06:00
git actions v2
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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' };
|
||||
|
||||
Reference in New Issue
Block a user