Automated update of Base Application package.
This commit is contained in:
parent
39fc10b796
commit
8e60d8f75e
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/app-1.0.0.tar.gz
vendored
BIN
dist/app-1.0.0.tar.gz
vendored
Binary file not shown.
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user