diff --git a/CHANGELOG.md b/CHANGELOG.md index c929dee..27a66ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v1.0.22-25 +## v1.0.22-26 - update diff --git a/jobs_gorm/jobs_gorm.go b/jobs_gorm/jobs_gorm.go index d6cd0b5..e2b6b71 100644 --- a/jobs_gorm/jobs_gorm.go +++ b/jobs_gorm/jobs_gorm.go @@ -68,7 +68,7 @@ func (jobsGorm *JobsGorm) CreateInCustomId(config *ConfigCreateInCustomId) error UpdatedIp: jobsGorm.outsideIp, }) if createStatus.RowsAffected == 0 { - return errors.New(fmt.Sprintf("创建任务失败:%s", createStatus.Error)) + return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, createStatus.Error)) } return nil } @@ -88,7 +88,7 @@ type ConfigCreateInCustomIdOnly struct { func (jobsGorm *JobsGorm) CreateInCustomIdOnly(config *ConfigCreateInCustomIdOnly) error { query := jobsGorm.TaskTypeTakeIn(config.Tx, config.CustomId, config.Type) if query.Id != 0 { - return errors.New("任务已存在") + return errors.New(fmt.Sprintf("%d:[%s@%s]任务已存在", query.Id, config.CustomId, config.Type)) } createStatus := config.Tx.Create(&Task{ Status: jobs_common.TASK_IN, @@ -104,7 +104,7 @@ func (jobsGorm *JobsGorm) CreateInCustomIdOnly(config *ConfigCreateInCustomIdOnl UpdatedIp: jobsGorm.outsideIp, }) if createStatus.RowsAffected == 0 { - return errors.New(fmt.Sprintf("创建任务失败:%s", createStatus.Error)) + return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, createStatus.Error)) } return nil } @@ -138,7 +138,7 @@ func (jobsGorm *JobsGorm) CreateInCustomIdMaxNumber(config *ConfigCreateInCustom UpdatedIp: jobsGorm.outsideIp, }) if createStatus.RowsAffected == 0 { - return errors.New(fmt.Sprintf("创建任务失败:%s", createStatus.Error)) + return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, createStatus.Error)) } return nil } @@ -159,7 +159,7 @@ type ConfigCreateInCustomIdMaxNumberOnly struct { func (jobsGorm *JobsGorm) CreateInCustomIdMaxNumberOnly(config *ConfigCreateInCustomIdMaxNumberOnly) error { query := jobsGorm.TaskTypeTakeIn(config.Tx, config.CustomId, config.Type) if query.Id != 0 { - return errors.New("任务已存在") + return errors.New(fmt.Sprintf("%d:[%s@%s]任务已存在", query.Id, config.CustomId, config.Type)) } createStatus := config.Tx.Create(&Task{ Status: jobs_common.TASK_IN, @@ -176,7 +176,7 @@ func (jobsGorm *JobsGorm) CreateInCustomIdMaxNumberOnly(config *ConfigCreateInCu UpdatedIp: jobsGorm.outsideIp, }) if createStatus.RowsAffected == 0 { - return errors.New(fmt.Sprintf("创建任务失败:%s", createStatus.Error)) + return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, createStatus.Error)) } return nil } diff --git a/version.go b/version.go index 2f295f7..08b69c4 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package gojobs -const Version = "1.0.25" +const Version = "1.0.26"