Skip to content

Commit

Permalink
fix: cacheにキーがなかった場合の動作がない
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Oct 10, 2024

Verified

This commit was signed with the committer’s verified signature.
yupix yupix
1 parent f4faa67 commit dcd1269
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mipac/utils/cache.py
Original file line number Diff line number Diff line change
@@ -102,6 +102,9 @@ async def wrapper(self, *args, **kwargs):
hit_item = target_cache.get(key)
if hit_item and override is False and kwargs.get("cache_override") is None:
return hit_item
res = await func(self, *args, **kwargs)
target_cache.put(key, res)
return res
except KeyError:
res = await func(self, *args, **kwargs)
target_cache.put(key, res)

0 comments on commit dcd1269

Please sign in to comment.