From f25eee433c0178e61febc015932f3e9d5fb55185 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 9 Dec 2019 21:07:50 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 528f0d6..8598c48 100644 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -124,6 +124,7 @@ class PythonScriptProcessor(BaseProcessor): g = ServerEnv() lenv = self.run_ns del lenv['request'] + """ if not g.get('dspy_cache',False): g.dspy_cache = ObjectCache() func = g.dspy_cache.get(self.path) @@ -133,6 +134,10 @@ class PythonScriptProcessor(BaseProcessor): func = lenv['myfunc'] print('func=',func) g.dspy_cache.store(self.path,func) + """ + txt = self.loadScript() + exec(txt,lenv,lenv) + func = lenv['myfunc'] self.content = await func(request,**lenv) class MarkdownProcessor(BaseProcessor):