获取站点的日志切割任务 @author baozi <202-02-27> @param: get ( dict ): name @return msg : 操作结果
(self, get)
| 3039 | return public.returnMsg(True, '设置成功') |
| 3040 | |
| 3041 | def get_log_split(self, get): |
| 3042 | """获取站点的日志切割任务 |
| 3043 | @author baozi <202-02-27> |
| 3044 | @param: |
| 3045 | get ( dict ): name |
| 3046 | @return msg : 操作结果 |
| 3047 | """ |
| 3048 | |
| 3049 | name = get.name.strip() |
| 3050 | project_conf = self._get_project_conf(name_id=name) |
| 3051 | if not project_conf: |
| 3052 | return public.returnMsg(False, "没有该项目,请尝试刷新页面") |
| 3053 | cronInfo = public.M('crontab').where('name=?', (f'[勿删]Python项目[{name}]运行日志切割',)).find() |
| 3054 | if not cronInfo: |
| 3055 | return public.returnMsg(False, "该项目没有设置运行日志的切割任务") |
| 3056 | |
| 3057 | if "log_conf" not in project_conf: |
| 3058 | return public.returnMsg(False, "日志切割配置丢失,请尝试重新设置") |
| 3059 | res = project_conf["log_conf"] |
| 3060 | res["status"] = cronInfo["status"] |
| 3061 | return {"status": True, "data": res} |
| 3062 | |
| 3063 | # —————————————————————————————————————————————— |
| 3064 | # 对用户的项目目录进行预先读取, 获取有效信息 | |
nothing calls this directly
no test coverage detected