devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
978 stars 294 forks source link

[Feature Request][NOWEB] API route or any other way to clear messages from storage #592

Open butteryreapply2 opened 1 week ago

butteryreapply2 commented 1 week ago

We a planning to run a system with lots of active sessions (100+) for a long period of time and potential problem we found is that we can run out of free space.

Describe the solution you'd like

Two solutions are applicable:

  1. TTL for message in storage. For example TTL=3600 - messages that were received hour ago will be deleted.
  2. API route that clear messages with given filter (created_at_gte e.g.).

Describe alternatives you've considered Completely removing session and login again. But it'll require whole auth flow checks again. Also there is no clear way to understand if particular session using too much space.

patron:PLUS

devlikepro commented 1 week ago

Hi!

  1. Do you use MongoDB or files to store data?
  2. How much storage space are we talking about here? In GB if possible

patron:PRO

butteryreapply2 commented 1 week ago
  1. files
  2. We make some estimates, in one year time there will be around 30gb by our estimates (around 400 sessions).

patron:PLUS

devlikepro commented 6 days ago

will be around 30gb by our estimates (around 400 sessions)

That's pretty fine for the number.

Because after few months likely many sessions will get re-paired (due to WhatsApp changes), so it means the sessions won't fully be synced and 30gb nowadays is nothing (compared to dev time and effort) Unlikely we'll add something like cleanup api soon, but we'll keep eye on it, thank you for the details!

patron:PRO