Skip to content

Commit

Permalink
remove health check, im losing braincells
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Dec 29, 2024
1 parent ac89a57 commit 7acf02b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import traceback

import asyncio
import uvicorn
import disnake
import platform
import sentry_sdk
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from pymongo import MongoClient
from pytz import utc

from fastapi import FastAPI
import threading
from classes.bot import CustomClient
from utility.startup import create_config, get_cluster_breakdown, load_cogs, sentry_filter

Expand Down Expand Up @@ -65,23 +62,10 @@
'background.logs.war',
"background.features.refresh_boards"
]
health_app = FastAPI()
@health_app.get("/health")
async def health_check():
if bot.is_ready():
return {"status": "ok", "details": "Bot is running and ready"}
else:
return {"status": "error", "details": "Bot is not ready"}

def run_health_check_server():
uvicorn.run(health_app, host="127.0.0.1", port=8000)

if __name__ == '__main__':

# Start FastAPI server in a background thread
threading.Thread(target=run_health_check_server, daemon=True).start()


sentry_sdk.init(
dsn=config.sentry_dsn,
traces_sample_rate=1.0,
Expand Down

0 comments on commit 7acf02b

Please sign in to comment.