MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / StartProject

Method StartProject

class/projectModel/pythonModel.py:1331–1355  ·  view source on GitHub ↗
(self, get)

Source from the content-addressed store, hash-verified

1329 return public.returnMsg(False, "项目启动失败")
1330
1331 def StartProject(self, get):
1332 project_name = None
1333 if hasattr(get, "name"):
1334 project_name = get.name.strip()
1335 if hasattr(get, "project_name"):
1336 project_name = get.project_name.strip()
1337 if not project_name:
1338 return public.returnMsg(False, "请选择要启动的项目")
1339
1340 project_find = self.get_project_find(project_name)
1341 if not project_find:
1342 return public.returnMsg(False, "没有该项目,请尝试刷新页面后重试")
1343 # 2024.4.3 修复项目过期时间判断不对
1344 mEdate = time.strftime('%Y-%m-%d', time.localtime())
1345 if project_find['edate'] != "0000-00-00" and project_find['edate'] < mEdate:
1346 return public.return_error('当前项目已过期,请重新设置项目到期时间')
1347
1348 from mod.project.python.serviceMod import ServiceManager
1349
1350 s_mgr = ServiceManager.new_mgr(project_name)
1351 if isinstance(s_mgr, str):
1352 return public.returnMsg(False, s_mgr)
1353
1354 s_mgr.start_project()
1355 return public.returnMsg(True, "启动指令已执行,请注意查看日志")
1356
1357 def start_project(self, get):
1358 get.name = get.project_name

Callers 3

start_projectMethod · 0.95
auto_runMethod · 0.95
PythonDaemonsFunction · 0.80

Calls 4

get_project_findMethod · 0.95
returnMsgMethod · 0.80
new_mgrMethod · 0.80
start_projectMethod · 0.45

Tested by

no test coverage detected