fix 定时任务日志清理

This commit is contained in:
yxh 2025-07-16 10:37:33 +08:00
parent 84f785cd03
commit 8025d56a2b
2 changed files with 3 additions and 3 deletions

View File

@ -53,9 +53,9 @@ func (s *sSysJobLog) List(ctx context.Context, req *system.SysJobLogListReq) (li
return return
} }
func (s *sSysJobLog) Delete(ctx context.Context, logIds []uint64) (err error) { func (s *sSysJobLog) Delete(ctx context.Context, targetName string) (err error) {
err = g.Try(ctx, func(ctx context.Context) { err = g.Try(ctx, func(ctx context.Context) {
_, err = dao.SysJobLog.Ctx(ctx).Delete(dao.SysJobLog.Columns().Id+" in (?)", logIds) _, err = dao.SysJobLog.Ctx(ctx).Delete(dao.SysJobLog.Columns().TargetName, targetName)
liberr.ErrIsNil(ctx, err, "删除失败") liberr.ErrIsNil(ctx, err, "删除失败")
}) })
return return

View File

@ -16,7 +16,7 @@ type (
ISysJobLog interface { ISysJobLog interface {
Add(ctx context.Context, data *do.SysJobLog) (err error) Add(ctx context.Context, data *do.SysJobLog) (err error)
List(ctx context.Context, req *system.SysJobLogListReq) (listRes *system.SysJobLogListRes, err error) List(ctx context.Context, req *system.SysJobLogListReq) (listRes *system.SysJobLogListRes, err error)
Delete(ctx context.Context, logIds []uint64) (err error) Delete(ctx context.Context, targetName string) (err error)
} }
) )