Pequenas adições de console.log

pull/21/head
adriano 2023-04-08 18:31:37 -03:00
parent 6d9bef094f
commit b43e76938f
4 changed files with 26 additions and 9 deletions

View File

@ -12,7 +12,8 @@ import { loadSchedulesCache } from "./helpers/SchedulingNotifyCache";
import { delRestoreControllFile } from "./helpers/RestoreControll";
import "./helpers/SchedulingNotifySendMessage"
import axios from "axios";
import os from 'os';
const server = app.listen(process.env.PORT, () => {
logger.info(`Server started on port: ${process.env.PORT}`);
@ -33,6 +34,8 @@ gracefulShutdown(server);
(async () => {
console.log('os.tmpdir(): ', os.tmpdir())
let whatsapps: any = await Whatsapp.findAll({ attributes: ['id', 'url'] })
// console.log('whatsapps: ', whatsapps)
@ -43,12 +46,20 @@ gracefulShutdown(server);
try {
const response = await endPointQuery(`${whatsapps[i].dataValues.url}/api/status`, {})
console.log(`API URL: ${whatsapps[i].dataValues.url}/api/connection/status`)
const response = await axios.get(`${whatsapps[i].dataValues.url}/api/connection/status`, {});
console.log(`-------> Response: ${response.data.data}`)
if (!response) {
throw new Error('Response null');
}
if (response.data.data && response.data.data == 'CONNECTED') {
await whatsapps[i].update({ status: 'CONNECTED' });
}
} catch (error: any) {
await whatsapps[i].update({ status: 'OPENING' });

View File

@ -19,7 +19,7 @@ interface Request {
const CreateMessageService = async ({ messageData }: Request): Promise<Message> => {
// console.log('UPSERT MESSAGE messageData: ', messageData)
console.log('UPSERT MESSAGE messageData: ', messageData)
await Message.upsert(messageData);

View File

@ -419,6 +419,8 @@ const handleMessage = async (
wbot: any
): Promise<void> => {
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
if (!msg.fromMe) {
_clear_lst()
@ -558,6 +560,10 @@ const handleMessage = async (
}
//
if(msg.fromMe){
console.log('====> msg.fromMe: ',msg.fromMe)
}
if (msg.hasMedia) {
await verifyMediaMessage(msg, ticket, contact, wbot.media, wbot.quotedMsg);