diff --git a/check_task.go b/check_task.go deleted file mode 100644 index 572dd1d..0000000 --- a/check_task.go +++ /dev/null @@ -1,40 +0,0 @@ -package gojobs - -import ( - "context" - "go.dtapp.net/gojobs/jobs_gorm_model" - "go.dtapp.net/gotime" - "gorm.io/gorm" -) - -// CheckManyTask 多任务检查 -func (c *Client) CheckManyTask(ctx context.Context, tx *gorm.DB, vs []jobs_gorm_model.Task) { - if len(vs) > 0 { - for _, v := range vs { - diffInSecondWithAbs := gotime.Current().DiffInSecondWithAbs(gotime.SetCurrent(v.UpdatedAt).Time) - if diffInSecondWithAbs >= v.Frequency*3 { - if c.config.debug == true { - c.zapLog.WithTraceId(ctx).Sugar().Infof("[jobs.CheckManyTask]每隔%v秒任务:%v相差%v秒\n", v.Frequency, v.Id, diffInSecondWithAbs) - } - err := tx.Where("task_id = ?", v.Id).Where("run_id = ?", v.RunId).Delete(&jobs_gorm_model.TaskLogRun{}).Error - if err != nil { - c.zapLog.WithTraceId(ctx).Sugar().Errorf("删除失败:%s", err.Error()) - } - } - } - } -} - -// CheckSingleTask 单任务检查 -func (c *Client) CheckSingleTask(ctx context.Context, tx *gorm.DB, v jobs_gorm_model.Task) { - diffInSecondWithAbs := gotime.Current().DiffInSecondWithAbs(gotime.SetCurrent(v.UpdatedAt).Time) - if diffInSecondWithAbs >= v.Frequency*3 { - if c.config.debug == true { - c.zapLog.WithTraceId(ctx).Sugar().Infof("[jobs.CheckManyTask]每隔%v秒任务:%v相差%v秒\n", v.Frequency, v.Id, diffInSecondWithAbs) - } - err := tx.Where("task_id = ?", v.Id).Where("run_id = ?", v.RunId).Delete(&jobs_gorm_model.TaskLogRun{}).Error - if err != nil { - c.zapLog.WithTraceId(ctx).Sugar().Errorf("删除失败:%s", err.Error()) - } - } -} diff --git a/const.go b/const.go index 1482c1a..0db82fd 100644 --- a/const.go +++ b/const.go @@ -1,6 +1,6 @@ package gojobs const ( - Version = "1.0.85" + Version = "1.0.86" SpecifyIpNull = "0.0.0.0" )