- update jobs

master v1.0.80
李光春 1 year ago
parent 7c2e03cab2
commit 878fa2fdba

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.79"
return "1.0.80"
}

@ -25,10 +25,9 @@ type ClientConfig struct {
// Client 实例
type Client struct {
gormClient *dorm.GormClient // 数据库
mongoClient *dorm.MongoClient // 数据库
zapLog *golog.ZapLog // 日志服务
config struct {
gormClient *dorm.GormClient // 数据库
zapLog *golog.ZapLog // 日志服务
config struct {
systemHostname string // 主机名
systemOs string // 系统类型
systemVersion string // 系统版本

@ -24,6 +24,7 @@ type systemResult struct {
CpuMhz float64 // CPU兆赫
}
// 获取系统信息
func getSystem() (result systemResult) {
hInfo, err := host.Info()
@ -60,6 +61,7 @@ func getSystem() (result systemResult) {
return result
}
// 设置配置信息
func (c *Client) setConfig(ctx context.Context) {
info := getSystem()

@ -6,6 +6,5 @@ var (
currentIpNoConfig = errors.New("请配置 CurrentIp")
redisPrefixFunNoConfig = errors.New("请配置 RedisPrefixFun")
gormClientFunNoConfig = errors.New("请配置 GormClientFun")
mongoClientFunNoConfig = errors.New("请配置 MongoClientFun")
TaskIsExist = errors.New("任务已存在")
)

@ -2,7 +2,6 @@ package gojobs
import (
"github.com/redis/go-redis/v9"
"go.mongodb.org/mongo-driver/mongo"
"gorm.io/gorm"
)
@ -11,11 +10,6 @@ func (c *Client) GetDb() *gorm.DB {
return c.gormClient.GetDb()
}
// GetMongoDb 获取数据库驱动
func (c *Client) GetMongoDb() *mongo.Client {
return c.mongoClient.GetDb()
}
// GetRedis 获取缓存数据库驱动
func (c *Client) GetRedis() *redis.Client {
return c.cache.redisClient.GetDb()

@ -30,8 +30,6 @@ github.com/clbanning/mxj
# github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
## explicit
github.com/dgryski/go-rendezvous
# github.com/fsnotify/fsnotify v1.5.4
## explicit; go 1.16
# github.com/gin-contrib/sse v0.1.0
## explicit; go 1.12
github.com/gin-contrib/sse

Loading…
Cancel
Save