From eda0a4ef22d4517ce40cc495cb9310a04540001b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Sat, 11 Jun 2022 16:55:25 +0800 Subject: [PATCH] - update --- CHANGELOG.md | 2 +- jobs_gorm/jobs_gorm.go | 12 ++++++------ version.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) 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"