#Fix to Bot freezing after a while on heroku

36 messages · Page 1 of 1 (latest)

warm peak
#

When the whatsapp bot stays for too long without activity, the client stops responding.
How would i a be able to fix this?
I have tried using both Local and RemoteAuth
My puppeteer settings are as follows:
puppeteer: { headless: true,args: ['--no-sandbox', '--disable-setuid-sandbox']}

I also found this github issue
I don't know if another found a solution to this
https://github.com/pedroslopez/whatsapp-web.js/issues/377

Any help or guide will be appreciated

GitHub

When whatsapp web stays for too long without activity, the client stop responding. Try this: Read the QR code and leave the app during the night; When the app stay for too long with no messages rec...

sinful crescent
#

This

warm peak
warm peak
# sinful crescent This

Here is the fix

What caused the issue : Heroku freezes a project after a certain period of inactivity and this applies for the project running on free dynos
Which coincidentally ends tomorrow

FIX :
Have a site that pings your project regularly for example after every 5 minutes

A perfect one would be one for checking the status of your server such as the one below

https://uptimerobot.com/

sinful crescent
#

nah im not using heroku

#

the client literally just dies on my paid vps

#

forcing me to restart my node process daily

near shadow
#

this needs fixing, hasn't been fixed yet

spare trench
#

I use pm2 and had a cron to restart browser every morning at 12am

sinful crescent
#

Do u restart ur entire node process?

sinful crescent
spare trench
sinful crescent
#

Ty

spare trench
near shadow
#

I personally restart my apps every even hour with pm2 cron as well

#

the restart takes under a minute and doesn't bother service

#

if you are really needing more uptime do one every 4 minutes instead

#

though I don't know if heroku is supporting pm2

warm peak
near shadow
#

I say personally I restart my WhatsApp Web connection every hour to ensure stability and making sure it doesn't freeze

#

I use PM2 to manage my node.js programs

near shadow
#

and pm2 has its own cron

#

it is a runtime to manage the node runtime

#

read up on ir

#

I don't use Heroku, so the need to ping wouldn't be of a use to me

warm peak
warm peak
near shadow
#

well actually that is what @left tinsel

#

did

#

he implemented the store stuff

#

remote store*

warm peak
# near shadow well actually that is what <@491474256178446338>

Nice
Well what i did is just looked at the remote store code and the mongo one and just enabled the user to save the ids in mongo and the authentication zips in their server
I had an issue where i did not want to create the client after the initialisation of mongoose connection with the database
Should i share the code ?
It's nothing big but it is (kind of) fun