Skip to content

Commit

Permalink
bug fix for logger in dredis_cache_set
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed Nov 1, 2024
1 parent d4f2018 commit 7941ca1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/components/django_redis_cache_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def dredis_cache_set(prefix: str, pk: int, **kwargs: dict) -> None:
for key, value in kwargs.items():
redis_key = prefix + ":" + str(pk) + ":" + key
logger.debug(f"redis key : {redis_key}")
logger.debug(f"redis value : {value.__dict__}")
if hasattr(value, '__dict__'):
logger.debug(f"redis value : {value.__dict__}")
else:
logger.debug(f"redis value : {value}")
result = cache.set(redis_key, value, timeout=CACHE_TTL, nx=False)
logger.debug(f"cache.set result : {result}")

Expand Down

0 comments on commit 7941ca1

Please sign in to comment.