diff --git a/src/gausskernel/dbmind/tools/common/http/controller_aop.py b/src/gausskernel/dbmind/tools/common/http/controller_aop.py index 95be44f5e..594277216 100644 --- a/src/gausskernel/dbmind/tools/common/http/controller_aop.py +++ b/src/gausskernel/dbmind/tools/common/http/controller_aop.py @@ -27,6 +27,17 @@ def do_after(rt_result): def do_exception(exception): """Nothing""" + +#function name: around +#description: Preserve the function properties and prevent an error from terminating the program +#arguments: One or more functions +#return value: none +#note: Decorators are implemented in such a way that the function being decorated is actually another function (the function name and other properties change). +#To avoid this, Python's FuncTools package provides a decorator called wraps to remove such side effects. +#When writing a decorator, it is a good idea to wrap FuncTools before implementing it. +#It preserves the name and properties of the original function +#date: 2022/8/4 +#contact: 1865997821 def around(func, *args, **kw): @wraps(func) def wrapper():