danielgross / whatsapp-gpt

MIT License
3.07k stars 596 forks source link

500 Internal Server Error #65

Open stylarene opened 1 year ago

stylarene commented 1 year ago

How can I fix it so that this error no longer occurs after a long period of inactivity?

NicerDicerPlus15 commented 1 year ago

You can create a bash script that restarts server.py every hour or so with:

#!/usr/bin/bash

while true
do

    # Launch Script
    python3 server.py &

    # Get PID
    PID=$!

    # Wait 1 hour
    sleep 1h

    # Kill it
    kill $PID

done

Thus, the error no longer occurred for me.

Huskynarr commented 1 year ago

Alternativ as Python script to unify the codebase:

import subprocess
import time

while True:
    # Launch Script
    subprocess.Popen(["python3", "server.py"])

    # Wait 1 hour
    time.sleep(3600)

    # Kill it
    subprocess.call(["pkill", "-f", "server.py"])
tony6012 commented 1 year ago

https://imgur.com/a/nngakIm

tony6012 commented 1 year ago

having this issue multiple times, please help if you can