- 优化任务
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
64ee822347
commit
3f7d37d014
@ -1,4 +1,4 @@
|
||||
package gojobs
|
||||
package jobs_common
|
||||
|
||||
const (
|
||||
TASK_IN = "IN" // 任务运行
|
@ -1,18 +1,37 @@
|
||||
package jobs_gorm
|
||||
|
||||
import "gorm.io/gorm"
|
||||
import "go.dtapp.net/goredis"
|
||||
import (
|
||||
"go.dtapp.net/goarray"
|
||||
"go.dtapp.net/goip"
|
||||
"go.dtapp.net/gojobs"
|
||||
"go.dtapp.net/goredis"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
type JobsGorm struct {
|
||||
RunVersion string // 运行版本
|
||||
Os string // 系统类型
|
||||
Arch string // 系统架构
|
||||
MaxProCs int // CPU核数
|
||||
Version string // GO版本
|
||||
MacAddrS string // Mac地址
|
||||
InsideIp string // 内网ip
|
||||
OutsideIp string // 外网ip
|
||||
MainService int // 主要服务
|
||||
runVersion string // 运行版本
|
||||
os string // 系统类型
|
||||
arch string // 系统架构
|
||||
maxProCs int // CPU核数
|
||||
version string // GO版本
|
||||
macAddrS string // Mac地址
|
||||
insideIp string // 内网ip
|
||||
outsideIp string // 外网ip
|
||||
mainService int // 主要服务
|
||||
Db *gorm.DB // 数据库
|
||||
Redis goredis.App // 缓存数据库服务
|
||||
}
|
||||
|
||||
func NewGorm(jobsGorm JobsGorm, mainService int) *JobsGorm {
|
||||
jobsGorm.runVersion = gojobs.Version
|
||||
jobsGorm.os = runtime.GOOS
|
||||
jobsGorm.arch = runtime.GOARCH
|
||||
jobsGorm.maxProCs = runtime.GOMAXPROCS(0)
|
||||
jobsGorm.version = runtime.Version()
|
||||
jobsGorm.macAddrS = goarray.TurnString(goip.GetMacAddr())
|
||||
jobsGorm.insideIp = goip.GetInsideIp()
|
||||
jobsGorm.outsideIp = goip.GetOutsideIp()
|
||||
jobsGorm.mainService = mainService
|
||||
return &jobsGorm
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
package gojobs
|
||||
|
||||
const Version = "1.0.18"
|
||||
const Version = "1.0.19"
|
||||
|
Loading…
Reference in new issue