waha icon indicating copy to clipboard operation
waha copied to clipboard

[Feature Request] - Do not restart STOPPED sessions when WHATSAPP_RESTART_ALL_SESSIONS=True (keep track of session status)

Open HuangDaHui opened this issue 1 year ago • 5 comments

After stopping sessions, it will automatically change to SCAN_QR_CODE after a period of time. Can it remain stopped?

HuangDaHui avatar Aug 12 '24 02:08 HuangDaHui

@HuangDaHui hi! Could it because of the container restart AND WHATSAPP_RESTART_ALL_SESSIONS=True flag enabled? https://waha.devlike.pro/docs/how-to/config/#sessions Because it does restarts all sessions, including STOPPED one.

If it happens even without container restart - this is a bug, please let us know if it's the case!

patron:PRO

devlikepro avatar Aug 12 '24 02:08 devlikepro

it does restarts all sessions, including STOPPED one.

We could track session status and run only working or failed one tho :thinking:

Before making it possible we need to handle workers approach as well, so if one shares a single store across multiple workers we restart the session only on the previous worker

patron:PRO

devlikepro avatar Aug 12 '24 02:08 devlikepro

WHATSAPP_RESTART_ALL_SESSIONS=True

Yes, I set this variable to true, WHATSAPP_RESTART_ALL_SESSIONS=True I now think false would be better, thanks for your answer

HuangDaHui avatar Aug 12 '24 03:08 HuangDaHui

I now think false would be better

But it WILL NOT start sessions at all after the container restart. WAHA doesn't start even WORKING one by default, all sessions will be STOPPED So when it happens during the night you need to either make it manually or write a script.

Let's keep the issue open, I think we could handle it on the project side, keeping the status and not restarting STOPPED one looks like the best solution

patron:PRO

devlikepro avatar Aug 12 '24 03:08 devlikepro

Yes, I agree, looking forward to your updates

HuangDaHui avatar Aug 12 '24 05:08 HuangDaHui

2024.10.5 If you remove now WHATSAPP_RESTART_ALL_SESSIONS=True - WAHA remembers the session status and restore it on restart (meaning it will not re-run STOPPED sessions)

patron:PRO

devlikepro avatar Oct 16 '24 09:10 devlikepro

@BavariaAnde WHATSAPP_RESTART_ALL_SESSIONS doesn't work in waha core, you need to start it manually and provide session config as well

You can find details in https://github.com/devlikeapro/waha/issues/741#issuecomment-2600774278

patron:PRO

devlikepro avatar May 18 '25 02:05 devlikepro