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

Method RestartProject

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

Source from the content-addressed store, hash-verified

1459 return self.RestartProject(get)
1460
1461 def RestartProject(self, get):
1462 name = get.name.strip()
1463 project_find = self.get_project_find(name)
1464 if not project_find:
1465 return public.returnMsg(False, "没有该项目,请尝试刷新页面后重试")
1466 # 2024.4.3 修复项目过期时间判断不对
1467 mEdate = time.strftime('%Y-%m-%d', time.localtime())
1468 if project_find['edate'] != "0000-00-00" and project_find['edate'] < mEdate:
1469 return public.return_error('当前项目已过期,请重新设置项目到期时间')
1470 conf = project_find["project_config"]
1471 if self.prep_status(conf) == "running":
1472 return public.returnMsg(False, "项目环境安装制作中.....<br>请勿操作")
1473 from mod.project.python.serviceMod import ServiceManager
1474
1475 s_mgr = ServiceManager.new_mgr(name)
1476 if isinstance(s_mgr, str):
1477 return public.returnMsg(False, s_mgr)
1478
1479 s_mgr.stop_project()
1480 s_mgr.start_project()
1481 return public.returnMsg(True, "项目重启指令已执行,请注意查看日志")
1482
1483 def stop_project(self, get):
1484 get.name = get.project_name

Callers 3

restart_projectMethod · 0.95
mainFunction · 0.80

Calls 6

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

Tested by

no test coverage detected