MCPcopy Create free account
hub / github.com/Boris-code/feapder / wapper

Function wapper

feapder/utils/tools.py:175–185  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

173 def _retry(func):
174 @functools.wraps(func) # 将函数的原来属性付给新函数
175 def wapper(*args, **kwargs):
176 for i in range(retry_times):
177 try:
178 return func(*args, **kwargs)
179 except Exception as e:
180 log.error(
181 "函数 {} 执行失败 重试 {} 次. error {}".format(func.__name__, i + 1, e)
182 )
183 time.sleep(interval)
184 if i + 1 >= retry_times:
185 raise e
186
187 return wapper
188

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected