silence any errors here (in case API is down so it doesnt affect audio)

This commit is contained in:
Drapersniper
2020-09-30 11:00:28 +01:00
parent 318a006dac
commit 506c0998ef

View File

@@ -153,6 +153,7 @@ class GlobalCacheWrapper:
if not self.cog.global_api_user.get("can_delete"):
return
api_url = f"{_API_URL}api/v2/queries/es/id"
with contextlib.suppress(Exception):
async with self.session.delete(
api_url,
headers={"Authorization": self.api_key, "X-Token": self._handshake_token},
@@ -166,7 +167,7 @@ class GlobalCacheWrapper:
is_enabled = await self.config.global_db_enabled()
if (not is_enabled) or self.api_key is None:
return global_api_user
with contextlib.suppress(aiohttp.ContentTypeError, asyncio.TimeoutError):
with contextlib.suppress(Exception):
async with aiohttp.ClientSession(json_serialize=json.dumps) as session:
async with session.get(
f"{_API_URL}api/v2/users/me",