Automated update of Base Application package.

This commit is contained in:
bot 2025-01-24 15:05:29 +00:00
parent 39fc10b796
commit 8e60d8f75e
3 changed files with 10 additions and 3 deletions

Binary file not shown.

BIN
dist/app-1.0.0.tar.gz vendored

Binary file not shown.

View File

@ -25,9 +25,10 @@
# SOFTWARE. # SOFTWARE.
import json
import time import time
from functools import wraps from functools import wraps
import json
def time_cache(timeout: int = 600): def time_cache(timeout: int = 600):
def decorator(func): def decorator(func):
@ -35,7 +36,10 @@ def time_cache(timeout: int = 600):
@wraps(func) @wraps(func)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
key = (json.dumps(args,default=str), json.dumps(frozenset(kwargs.items()),default=str)) key = (
json.dumps(args, default=str),
json.dumps(frozenset(kwargs.items()), default=str),
)
current_time = time.time() current_time = time.time()
if key in cache: if key in cache:
@ -58,7 +62,10 @@ def time_cache_async(timeout: int = 600):
@wraps(func) @wraps(func)
async def wrapper(*args, **kwargs): async def wrapper(*args, **kwargs):
key = (json.dumps(args,default=str), json.dumps(frozenset(kwargs.items()),default=str)) key = (
json.dumps(args, default=str),
json.dumps(frozenset(kwargs.items()), default=str),
)
current_time = time.time() current_time = time.time()
if key in cache: if key in cache: