|
|
|
@ -62,16 +62,11 @@ func NewJobsGorm(attrs ...*OperationAttr) (*JobsGorm, error) {
|
|
|
|
|
if attr.lockPrefix != "" {
|
|
|
|
|
c.config.lockPrefix = attr.lockPrefix
|
|
|
|
|
}
|
|
|
|
|
if attr.outsideIp != "" {
|
|
|
|
|
c.config.outsideIp = attr.outsideIp
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c.config.runVersion = go_library.Version()
|
|
|
|
|
c.config.os = runtime.GOOS
|
|
|
|
|
c.config.arch = runtime.GOARCH
|
|
|
|
|
c.config.maxProCs = runtime.GOMAXPROCS(0)
|
|
|
|
|
c.config.version = runtime.Version()
|
|
|
|
|
c.config.macAddrS = goarray.TurnString(goip.GetMacAddr())
|
|
|
|
|
c.config.insideIp = goip.GetInsideIp()
|
|
|
|
|
|
|
|
|
|
if c.config.outsideIp == "" {
|
|
|
|
|
return nil, errors.New("需要配置当前的IP")
|
|
|
|
|
}
|
|
|
|
@ -80,6 +75,14 @@ func NewJobsGorm(attrs ...*OperationAttr) (*JobsGorm, error) {
|
|
|
|
|
return nil, errors.New("需要配置数据库驱动")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c.config.runVersion = go_library.Version()
|
|
|
|
|
c.config.os = runtime.GOOS
|
|
|
|
|
c.config.arch = runtime.GOARCH
|
|
|
|
|
c.config.maxProCs = runtime.GOMAXPROCS(0)
|
|
|
|
|
c.config.version = runtime.Version()
|
|
|
|
|
c.config.macAddrS = goarray.TurnString(goip.GetMacAddr())
|
|
|
|
|
c.config.insideIp = goip.GetInsideIp()
|
|
|
|
|
|
|
|
|
|
switch c.config.lockType {
|
|
|
|
|
case lockTypeRedis:
|
|
|
|
|
if c.db.redisClient == nil {
|
|
|
|
|