whatsapp-http-api
whatsapp-http-api copied to clipboard
Session would not be saved if server down or docker stop suddenly
Hi
I face to an issue like the step procedure as below:
-
Create and start new sessions named "session_test_01" and "session_test_02". OK
-
Scan QR Code to link WA account with WAHA app. OK
-
Stop docker - re-run docker.
Cannot query previous session.
Workaround:
I tried to hard-code the configuration with <-e "WHATSAPP_START_SESSION=session_test_01, session_test_02"> in docker run command and it will add 2 sessions but the status is "SCAN_QR_CODE".
Any advice for auto saving and auto init the previous session name list after instances down?
Thanks & Regards, Felix
Hi!
Any advice for auto saving
Could you share the command you run docker container with?
It should container -v
pwd/.sessions:/app/.sessions
.
If it doesn't work - please replace pwd with the real path, like this way - -v /home/allburov/.sessions:/app/.sessions
docker run --rm -d -v /home/allburov/.sessions:/app/.sessions -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api-plus
Any advice for ... auto init the previous session name list after instances down
You can set WHATSAPP_RESTART_ALL_SESSIONS=True
environment variable - on the container start it'll restart all STOPPED session.
It can't actually track which session was running so it'll restart all sessions - you can see the list by using GET /api/sessions/all=True
. If you don't want STOPPED session to be restart - you can logout it with POST /api/sessions/logout
Let me know if it helps!