Skip to content

Commit

Permalink
feat: stop log spam for missing tor_web_addr (#154)
Browse files Browse the repository at this point in the history
* Stop log spam for missing tor_web_addr

In case tor is not used, we can not find a tor_web_addr key in redis db. This will prevent from spamming the journal.

* log Redis DB missing Keys as Info

* log level Redis DB 

only tor as info
  • Loading branch information
ChuckNorrison authored Oct 16, 2022
1 parent bd19c41 commit 169da25
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ async def redis_get(key: str) -> str:
v = await redis_plugin.redis.get(key)

if not v:
logging.warning(f"Key '{key}' not found in Redis DB.")
logstr = f"Key '{key}' not found in Redis DB."
if "tor_web_addr" in key:
logging.info(logstr)
else:
logging.warning(logstr)
return ""

return v.decode("utf-8")
Expand Down

0 comments on commit 169da25

Please sign in to comment.