waha icon indicating copy to clipboard operation
waha copied to clipboard

[Question] NOWEB+Mongodb It takes a long time to download chat history attachments

Open HuangDaHui opened this issue 2 months ago • 5 comments

/api/default/chats/xxx/messages?downloadMedia=true&limit=5&offset=0 The request was canceled due to the configured HttpClient.Timeout of 600 seconds elapsing. There are only 5 records, and they cannot be retrieved normally after 600 seconds. Is there any other way to solve this problem?

HuangDaHui avatar Oct 24 '25 06:10 HuangDaHui

What causes such a long response time? Is it MongoDB or my server that has insufficient resources?

HuangDaHui avatar Oct 24 '25 06:10 HuangDaHui

Hi! Could you try fetch with downloadMedia=false first and the iterate one by one using https://waha.devlike.pro/docs/how-to/chats/#get-message-by-id ? Probalby there's an issue with 1 message that causes timeout.

Also logs would help 🙏

Mongodb doesn't save the file, it just saves messages, so shouldn't be a problem https://waha.devlike.pro/docs/how-to/storages/

patron:PRO

devlikepro avatar Nov 05 '25 08:11 devlikepro

Hi! Could you try fetch with downloadMedia=false first and the iterate one by one using https://waha.devlike.pro/docs/how-to/chats/#get-message-by-id ? Probalby there's an issue with 1 message that causes timeout.

Also logs would help 🙏

Mongodb doesn't save the file, it just saves messages, so shouldn't be a problem https://waha.devlike.pro/docs/how-to/storages/

patron:PRO

This is the method we're currently using, but we're still experiencing request timeouts, possibly because the file is too large. Would switching to PostgreSQL help?

HuangDaHui avatar Nov 05 '25 08:11 HuangDaHui

the file is too large.

In 60seconds you can download pretty big files 🤔

unlikely postgresql will help, need to check in the logs for the message what's happening, ideally

patron:PRO

devlikepro avatar Nov 05 '25 11:11 devlikepro

the file is too large.

In 60seconds you can download pretty big files 🤔

unlikely postgresql will help, need to check in the logs for the message what's happening, ideally

patron:PRO

Perhaps it's due to frequent synchronization? Because there are over 100 conversations, and within each conversation are chat logs from numerous contacts. Furthermore, I will continuously synchronize the data because occasionally webhooks may be missed.

HuangDaHui avatar Nov 06 '25 07:11 HuangDaHui