mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-08 15:51:11 +08:00
【新增】litessl
【新增】删除历史记录 【调整】批量删除证书
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user