Skip to content

Commit

Permalink
Make close_if_enabled() a private method
Browse files Browse the repository at this point in the history
There's probably no need for users to call it directly.
  • Loading branch information
JWCook committed Jul 23, 2023
1 parent 8668e7d commit a33331f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aiohttp_client_cache/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async def close(self):
await self.responses.close()
await self.redirects.close()

async def close_if_enabled(self):
async def _close_if_enabled(self):
"""Close any active connections, if ``autoclose`` is enabled"""
if self.autoclose:
await self.close()
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_client_cache/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def _request(
async def close(self):
"""Close both aiohttp connector and any backend connection(s) on contextmanager exit"""
await super().close()
await self.cache.close_if_enabled()
await self.cache._close_if_enabled()

@asynccontextmanager
async def disabled(self):
Expand Down

0 comments on commit a33331f

Please sign in to comment.