This commit is contained in:
doms9 2025-09-15 09:26:20 -04:00
parent 856ddda848
commit 00000d9186
10 changed files with 36 additions and 440 deletions

View file

@ -9,6 +9,7 @@ from .config import (
load_cache,
now,
safe_process_event,
write_cache,
)
__all__ = [
@ -22,4 +23,5 @@ __all__ = [
"load_cache",
"now",
"safe_process_event",
"write_cache",
]

View file

@ -130,6 +130,10 @@ def load_cache(
return data if now.timestamp() - ts < exp else {}
def write_cache(file: Path, data: dict) -> None:
file.write_text(json.dumps(data, indent=2), encoding="utf-8")
async def safe_process_event(
fn: Callable,
url_num: int,