bugfix
This commit is contained in:
parent
df879450ea
commit
39c64fb121
@ -17,6 +17,8 @@ class FunctionProcessor(BaseProcessor):
|
|||||||
BaseProcessor.__init__(self,path,resource)
|
BaseProcessor.__init__(self,path,resource)
|
||||||
|
|
||||||
async def path_call(self, request, path):
|
async def path_call(self, request, path):
|
||||||
|
await self.set_run_env(request)
|
||||||
|
parmas_kw = self.run_ns.get('params_kw')
|
||||||
path1 = request.path[len(self.config_opts['leading']):]
|
path1 = request.path[len(self.config_opts['leading']):]
|
||||||
args = []
|
args = []
|
||||||
if len(path1) > 0:
|
if len(path1) > 0:
|
||||||
@ -34,9 +36,11 @@ class FunctionProcessor(BaseProcessor):
|
|||||||
return None
|
return None
|
||||||
self.run_ns['request'] = request
|
self.run_ns['request'] = request
|
||||||
globals().update(self.run_ns)
|
globals().update(self.run_ns)
|
||||||
|
|
||||||
|
debug(f'params_kw={params_kw}, {args=}')
|
||||||
if inspect.iscoroutinefunction(f):
|
if inspect.iscoroutinefunction(f):
|
||||||
return await f(request, self.run_ns, *args)
|
return await f(request, params_kw, *args)
|
||||||
return f(request, self.run_ns, *args)
|
return f(request, params_kw, *args)
|
||||||
|
|
||||||
async def datahandle(self,request):
|
async def datahandle(self,request):
|
||||||
x = await self.path_call(request, self.path)
|
x = await self.path_call(request, self.path)
|
||||||
|
Loading…
Reference in New Issue
Block a user