minor
This commit is contained in:
		| @@ -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: | ||||||
|     """ |     """ | ||||||
|   | |||||||
| @@ -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)}")            | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user