open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.11k stars 589 forks source link

response delay #2614

Closed harthh closed 2 years ago

harthh commented 2 years ago

Are you using the latest version of the library?

What type of session are you experiencing this issue on?

Legacy (Normal)

What type of host account are you experiencing this issue on?

Business account

Mode

My own code

Current Behavior

have a whatsapp bot that serves several people, but I am suffering from a problem, my whatsapp bot is very slow to process the commands, for example:

if I type !menu , the function it took 1second to respond is now taking about 120seconds.

Expected Behavior

I expected the whatsapp bot to respond faster as it used to respond in 1 second and now it takes a long time

Steps To Reproduce

Before: User: !menu Bot cmd: [GROUP - PICTURES] 01/04 22:22:24 !menu from Test to Test (0.984s)

Now: User: !menu BOT cmd: [GROUP - PICTURES] 01/04 22:22:24 !menu from Test to Test (86.538s)

create() code

Nothing to declare

DEBUG INFO

{
  "WA_VERSION": "2.2210.9",
  "WA_AUTOMATE_VERSION": "4.33.1",
  "BROWSER_VERSION": "HeadlessChrome/100.0.4896.60",
  "START_TS": 1648862457565,
  "LATEST_VERSION": true,
  "CLI": false,
  "LAUNCH_TIME_MS": 20176,
  "ACC_TYPE": "BUSINESS",
  "chats": 987,
  "messages": 618,
  "contacts": 7127,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "9fe56633-c3ab-4710-be67-69a96c5d493d"
}

Environment

- OS: Windows 10
- Node: 16.13.2
- npm: 8.5.5

Screenshots/Logs

image

Anything else?

Nothing to declare

smashah commented 2 years ago

Your code is being locked up. Offload your command responses onto something like a p-queue (https://github.com/sindresorhus/p-queue)