refactor: remove license validation message for community version knowledge bases
This commit is contained in:
parent
94847bb8f0
commit
2cf01dd12c
@ -3,12 +3,12 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import uuid_utils.compat as uuid
|
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
|
import uuid_utils.compat as uuid
|
||||||
from diskcache import Cache
|
from diskcache import Cache
|
||||||
|
|
||||||
from maxkb.const import BASE_DIR
|
from maxkb.const import BASE_DIR, CONFIG
|
||||||
from maxkb.const import PROJECT_DIR
|
from maxkb.const import PROJECT_DIR
|
||||||
|
|
||||||
python_directory = sys.executable
|
python_directory = sys.executable
|
||||||
@ -39,14 +39,14 @@ class ToolExecutor:
|
|||||||
success = '{"code":200,"msg":"成功","data":exec_result}'
|
success = '{"code":200,"msg":"成功","data":exec_result}'
|
||||||
err = '{"code":500,"msg":str(e),"data":None}'
|
err = '{"code":500,"msg":str(e),"data":None}'
|
||||||
path = r'' + self.sandbox_path + ''
|
path = r'' + self.sandbox_path + ''
|
||||||
|
python_paths = CONFIG.get_sandbox_python_package_paths().split(',')
|
||||||
_exec_code = f"""
|
_exec_code = f"""
|
||||||
try:
|
try:
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
|
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
|
||||||
sys.path = [p for p in sys.path if p not in path_to_exclude]
|
sys.path = [p for p in sys.path if p not in path_to_exclude]
|
||||||
sys.path.append('/opt/maxkb-app/sandbox/python-packages')
|
sys.path += {python_paths}
|
||||||
sys.path.append('/opt/maxkb/python-packages')
|
|
||||||
env = dict(os.environ)
|
env = dict(os.environ)
|
||||||
for key in list(env.keys()):
|
for key in list(env.keys()):
|
||||||
if key in os.environ and (key.startswith('MAXKB') or key.startswith('POSTGRES') or key.startswith('PG')):
|
if key in os.environ and (key.startswith('MAXKB') or key.startswith('POSTGRES') or key.startswith('PG')):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user