Skip to content

Commit

Permalink
Fix unawaited cache delete async function
Browse files Browse the repository at this point in the history
fixes #4967
  • Loading branch information
daviddavis authored and dralley committed Jan 25, 2024
1 parent cd31fb6 commit ab03e8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES/4967.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed a warning that gets raised when cache is enabled: ``RuntimeWarning: coroutine
'AsyncCache.delete' was never awaited``.
2 changes: 1 addition & 1 deletion pulpcore/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ async def make_response(self, key, base_key):
expires and expires < time.time()
):
# Bad entry, delete from cache
self.delete(key, base_key)
await self.delete(key, base_key)
return None
response = self.RESPONSE_TYPES[response_type](**entry)
response.headers.update({"X-PULP-CACHE": "HIT"})
Expand Down

0 comments on commit ab03e8c

Please sign in to comment.