Aleração para desativar o auto restore

pull/21/head
adriano 2023-02-10 09:39:50 -03:00
parent 1dc329f29b
commit c4258b3431
5 changed files with 9 additions and 3 deletions

View File

@ -142,6 +142,8 @@ export const getRestoreControll = () => {
export const _restore = async (whatsapp: Whatsapp, msg_file_title: string) => { export const _restore = async (whatsapp: Whatsapp, msg_file_title: string) => {
return
if (whatsapp.status != 'RESTORING' && whatsapp.status != 'qrcode') { if (whatsapp.status != 'RESTORING' && whatsapp.status != 'qrcode') {
console.log('THE WHATSAAP ID: ', whatsapp.id, ' WILL BE RESTORED SOON!') console.log('THE WHATSAAP ID: ', whatsapp.id, ' WILL BE RESTORED SOON!')

View File

@ -7,6 +7,8 @@ let lstAutoRestore: any = []
// Delete a directory and its children // Delete a directory and its children
export const restoreMonit = (whatsappId: string | number) => { export const restoreMonit = (whatsappId: string | number) => {
return
try { try {
let lstRestore: any = getRestoreControll() let lstRestore: any = getRestoreControll()

View File

@ -50,7 +50,7 @@ gracefulShutdown(server);
console.log(`There was an error on try acess the api sessions ${whatsapps[i].dataValues.url}`) console.log(`There was an error on try acess the api sessions ${whatsapps[i].dataValues.url}`)
} }
await new Promise(f => setTimeout(f, 300)); await new Promise(f => setTimeout(f, 100));
} }
} }
@ -76,7 +76,7 @@ setTimeout(async () => {
console.log('USER ID: ', users[i].id) console.log('USER ID: ', users[i].id)
await new Promise(f => setTimeout(f, 500)); await new Promise(f => setTimeout(f, 300));
} }
} }

View File

@ -23,6 +23,8 @@ const fs = require('fs')
export const StartWhatsAppSession = async (whatsapp: Whatsapp, backupSession: boolean = false): Promise<void> => { export const StartWhatsAppSession = async (whatsapp: Whatsapp, backupSession: boolean = false): Promise<void> => {
return
await whatsapp.update({ status: "OPENING" }); await whatsapp.update({ status: "OPENING" });
const io = getIO(); const io = getIO();

View File

@ -46,7 +46,7 @@ const CreateWhatsAppService = async ({
try { try {
await schema.validate({ name, status, isDefault }); await schema.validate({ name, status, isDefault });
} catch (err) { } catch (err: any) {
throw new AppError(err.message); throw new AppError(err.message);
} }