From 609b96c84295cf94d9b21a4458d55503752273ed Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 11 Jan 2024 14:41:07 +0000 Subject: [PATCH] Show WHY A req failed --- .gitignore | 1 + src/cogs/ollama.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c2ae2f..676323b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff +.idea/ .idea/workspace.xml .idea/**/workspace.xml .idea/**/tasks.xml diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 9a2034e..6746835 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -36,6 +36,7 @@ class OllamaView(View): SERVER_KEYS = list(CONFIG["ollama"].keys()) + class Ollama(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @@ -71,7 +72,7 @@ class Ollama(commands.Cog): self.log.debug("%r is online.", resp.url.host) return resp.ok except (aiohttp.ClientConnectionError, asyncio.TimeoutError): - self.log.warning("%r is offline.", url) + self.log.warning("%r is offline.", url, exc_info=True) return False @commands.slash_command() @@ -204,6 +205,7 @@ class Ollama(commands.Cog): ) embed.set_footer(text="Using server %r" % server, icon_url=server_config.get("icon_url")) await ctx.edit(embed=embed) + await asyncio.sleep(1) if await self.check_server(CONFIG["ollama"][server]["base_url"]): server_config = CONFIG["ollama"][server] break