Skip to content

Commit

Permalink
chore: replace timeout with asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
wolffshots committed Jan 9, 2024
1 parent b50e99a commit 7dc84e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/audiobookshelf/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import socket

import aiohttp
import async_timeout

TIMEOUT = 10

Expand Down Expand Up @@ -69,7 +68,7 @@ async def api_wrapper(
else:
headers = {"Authorization": f"Bearer {self._access_token}"}
try:
async with async_timeout.timeout(TIMEOUT): # loop=asyncio.get_event_loop()
async with asyncio.timeout(TIMEOUT): # loop=asyncio.get_event_loop()
if method == "get":
response = await self._session.get(url, headers=headers)
if response.status >= 200 and response.status < 300:
Expand Down

0 comments on commit 7dc84e3

Please sign in to comment.