Skip to content

Commit

Permalink
Add api.py to keep the bot running
Browse files Browse the repository at this point in the history
  • Loading branch information
Zingzy committed Apr 3, 2024
1 parent a7ed071 commit d112c8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import Flask, jsonify
from threading import Thread
import subprocess

app = Flask("")

Expand All @@ -15,7 +16,11 @@ def health():


def run():
app.run(host="0.0.0.0", port=8080)
try:
server = subprocess.Popen(["gunicorn", "-w", "4", "api:app"])
return server
except:
app.run(host="0.0.0.0", port=8080)


def keep_alive():
Expand Down

0 comments on commit d112c8c

Please sign in to comment.