Skip to content

Commit

Permalink
better health check
Browse files Browse the repository at this point in the history
  • Loading branch information
ropc committed Mar 2, 2024
1 parent 6607159 commit 26d6fcb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ COPY tests ./tests
COPY meme_generator ./meme_generator
COPY memebot ./memebot

HEALTHCHECK CMD discordhealthcheck || exit 1
ENTRYPOINT [ "python", "-m" ]
CMD [ "memebot.memebot", "run" ]
2 changes: 2 additions & 0 deletions memebot/memebot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import logging
import discord
import discordhealthcheck
from discord.ext import commands
from discord.ext.commands.view import StringView
from pygtrie import CharTrie
Expand Down Expand Up @@ -55,6 +56,7 @@ async def setup_hook(self):
await self.add_cog(Whisper(whisper_config_filepath=os.getenv('WHISPER_CONFIG_FILE_PATH')))
await self.add_cog(Calendar())
await self.add_cog(ChatGPT(bot_id=self.user.id))
self.healthcheck_server = await discordhealthcheck.start(self)

async def on_command(self, context: commands.Context):
log.debug(f'received command {context.command}')
Expand Down
15 changes: 14 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [
"python-dateutil<3.0.0,>=2.8.2",
"dateparser<2.0.0,>=1.2.0",
"openai<2.0.0,>=1.12.0",
"discordhealthcheck>=0.1.1",
]
requires-python = "<4.0,>=3.12"
readme = "README.md"
Expand Down

0 comments on commit 26d6fcb

Please sign in to comment.