e
This commit is contained in:
parent
856ddda848
commit
00000d9186
10 changed files with 36 additions and 440 deletions
|
|
@ -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",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue