Skip to content

Commit

Permalink
only perform healthcheck if url provided
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Jan 28, 2025
1 parent 702770c commit e224f6a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cogs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from utils.data.database import db_players, db_mogis

from config import HEALTHCHECK_URL
from main import logger


class tasks(commands.Cog):
Expand All @@ -22,15 +21,16 @@ def __init__(self, bot):

@commands.Cog.listener()
async def on_ready(self):
self.ping_healthcheck.start()
if HEALTHCHECK_URL:
self.ping_healthcheck.start()

self.change_activity.start()
self.manage_state.start()
self.daily_db_backup.start()

# @tasks.loop(seconds=60)
# async def ping_healthcheck(self):
# logger.info("Pinging healthcheck...")
# requests.get(HEALTHCHECK_URL)
@tasks.loop(seconds=60)
async def ping_healthcheck(self):
requests.get(HEALTHCHECK_URL)

@tasks.loop(seconds=15)
async def change_activity(self):
Expand Down

0 comments on commit e224f6a

Please sign in to comment.