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

Method kill

class/btdockerModel/composeModel.py:717–736  ·  view source on GitHub ↗

强制停止项目 @param get: @return:

(self, get)

Source from the content-addressed store, hash-verified

715 return public.returnMsg(False, "{}项目失败: {}".format(status_info[status], e))
716
717 def kill(self, get):
718 """
719 强制停止项目
720 @param get:
721 @return:
722 """
723 if not hasattr(get, "project_id"):
724 return public.returnMsg(False, "缺少参数project_id!")
725
726 statcks_info = dp.sql("stacks").where("id=?", (get.project_id,)).find()
727 if not statcks_info:
728 return public.returnMsg(True, "没找到项目配置!")
729
730 if not hasattr(get, "status"):
731 return public.returnMsg(False, "缺少参数status!")
732
733 self.__host_temp(statcks_info, get.status)
734
735 dp.write_log("停止项目 [{}] 成功!".format(statcks_info['name']))
736 return public.returnMsg(True, "设置成功!")
737
738 def stop(self, get):
739 """

Callers 15

set_compose_statusMethod · 0.95
repetition_checkMethod · 0.80
exec_shellFunction · 0.80
maillog_event_serviceMethod · 0.80
site_task.pyFile · 0.80
stopMethod · 0.80
_is_runningMethod · 0.80
stop_by_kill_pidMethod · 0.80
force_stopMethod · 0.80
run_statusMethod · 0.80
termination_operationMethod · 0.80
stop_newMethod · 0.80

Calls 6

__host_tempMethod · 0.95
returnMsgMethod · 0.80
findMethod · 0.45
whereMethod · 0.45
write_logMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected