Increase logging verbosity of check_server

This commit is contained in:
Nexus 2024-04-14 18:11:57 +01:00
parent 4b9eab0bdb
commit 677973396a
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -498,10 +498,10 @@ class Ollama(commands.Cog):
if url in SERVER_KEYS: if url in SERVER_KEYS:
url = CONFIG["ollama"][url]["base_url"] url = CONFIG["ollama"][url]["base_url"]
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(10)) as session: async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(10)) as session:
self.log.debug("Checking if %r is online.", url) self.log.info("Checking if %r is online.", url)
try: try:
async with session.get(url + "/api/tags") as resp: async with session.get(url + "/api/tags") as resp:
self.log.debug("%r is online.", resp.url.host) self.log.info("%r is online.", resp.url.host)
return resp.ok return resp.ok
except (aiohttp.ClientConnectionError, asyncio.TimeoutError): except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
self.log.warning("%r is offline.", url, exc_info=True) self.log.warning("%r is offline.", url, exc_info=True)