|
|
@ -6,6 +6,7 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"go.dtapp.net/gojobs/jobs_gorm_model"
|
|
|
|
"go.dtapp.net/gojobs/jobs_gorm_model"
|
|
|
|
"go.dtapp.net/gostring"
|
|
|
|
"go.dtapp.net/gostring"
|
|
|
|
|
|
|
|
"go.dtapp.net/gotime"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -40,6 +41,7 @@ func (c *Client) CreateInCustomId(ctx context.Context, config *ConfigCreateInCus
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
|
|
|
|
NextRunTime: gotime.Current().AfterSeconds(config.Frequency).Time,
|
|
|
|
}).Error
|
|
|
|
}).Error
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
@ -82,6 +84,7 @@ func (c *Client) CreateInCustomIdOnly(ctx context.Context, config *ConfigCreateI
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
|
|
|
|
NextRunTime: gotime.Current().AfterSeconds(config.Frequency).Time,
|
|
|
|
}).Error
|
|
|
|
}).Error
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
@ -122,6 +125,7 @@ func (c *Client) CreateInCustomIdMaxNumber(ctx context.Context, config *ConfigCr
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
|
|
|
|
NextRunTime: gotime.Current().AfterSeconds(config.Frequency).Time,
|
|
|
|
}).Error
|
|
|
|
}).Error
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
@ -166,6 +170,7 @@ func (c *Client) CreateInCustomIdMaxNumberOnly(ctx context.Context, config *Conf
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
CreatedIp: config.CurrentIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
SpecifyIp: config.SpecifyIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
UpdatedIp: config.CurrentIp,
|
|
|
|
|
|
|
|
NextRunTime: gotime.Current().AfterSeconds(config.Frequency).Time,
|
|
|
|
}).Error
|
|
|
|
}).Error
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
|
return errors.New(fmt.Sprintf("创建[%s@%s]任务失败:%s", config.CustomId, config.Type, err.Error()))
|
|
|
|