【新增】litessl

【新增】删除历史记录
【调整】批量删除证书
This commit is contained in:
v-me-50
2026-01-13 16:12:29 +08:00
parent 44efcea14a
commit 6c15ae35a1
6 changed files with 98 additions and 0 deletions

View File

@@ -163,3 +163,31 @@ func CleanWorkflowHistory() error {
}
return nil
}
// DelWorkflowHistory 删除工作流执行历史记录
func DelWorkflowHistory(ids string) error {
idArr := strings.Split(ids, ",")
s, err := GetSqliteObjWH()
if err != nil {
return err
}
defer s.Close()
_, err = s.Where("id IN ('"+strings.Join(idArr, "','")+"')", nil).Delete()
if err != nil {
return err
}
// 删除工作流执行日志
logPath := public.GetSettingIgnoreError("workflow_log_path")
if logPath == "" {
logPath = "logs/workflow"
}
for _, id := range idArr {
logFile := filepath.Join(logPath, id+".log")
if _, err := os.Stat(logFile); err == nil {
if err := os.Remove(logFile); err != nil {
return err
}
}
}
return nil
}