Automated update of Base Application package.
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+10
-3
@@ -25,9 +25,10 @@
|
||||
# SOFTWARE.
|
||||
|
||||
|
||||
import json
|
||||
import time
|
||||
from functools import wraps
|
||||
import json
|
||||
|
||||
|
||||
def time_cache(timeout: int = 600):
|
||||
def decorator(func):
|
||||
@@ -35,7 +36,10 @@ def time_cache(timeout: int = 600):
|
||||
|
||||
@wraps(func)
|
||||
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()
|
||||
|
||||
if key in cache:
|
||||
@@ -58,7 +62,10 @@ def time_cache_async(timeout: int = 600):
|
||||
|
||||
@wraps(func)
|
||||
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()
|
||||
|
||||
if key in cache:
|
||||
|
||||
Reference in New Issue
Block a user