This commit is contained in:
codey 2025-02-16 06:53:41 -05:00
parent 8080d858f8
commit b15fab98b8
2 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import logging
import traceback import traceback
import time import time
import regex import regex
from regex import Pattern
import datetime import datetime
import os import os
import gpt import gpt
@ -17,7 +18,7 @@ from typing import Union, Optional, LiteralString
from uuid import uuid4 as uuid from uuid import uuid4 as uuid
from .constructors import RadioException from .constructors import RadioException
double_space = regex.compile(r'\s{2,}') double_space: Pattern = regex.compile(r'\s{2,}')
class RadioUtil: class RadioUtil:
""" """

View File

@ -108,10 +108,10 @@ class RedisCache:
""" """
try: try:
sources: list = ["cache", "lrclib", "genius", "failed"] sources: list = ["cache", "lrclib", "genius", "failed"]
counts: dict = {} counts: dict[str, int] = {}
for src in sources: for src in sources:
src_found_count = await self.redis_client.get(f"returned:{src}") src_found_count = await self.redis_client.get(f"returned:{src}")
counts[src] = src_found_count counts[src] = int(src_found_count) # Redis returns bytes
return counts return counts
except Exception as e: except Exception as e:
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}") await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}")