diff --git a/app/zeus/service/lark/model/init.go b/app/zeus/service/lark/model/init.go index 6cd7452..1b40bdd 100644 --- a/app/zeus/service/lark/model/init.go +++ b/app/zeus/service/lark/model/init.go @@ -1,13 +1,11 @@ package model import ( - "gorm.io/gorm" + "git.icechen.cn/monorepo/backend/pkg/orm" ) -var db *gorm.DB - func init() { - err := db.AutoMigrate(&UserInfo{}) + err := orm.DB.AutoMigrate(&UserInfo{}) if err != nil { panic(err) } diff --git a/pkg/etcd/etcd.go b/pkg/etcd/etcd.go index ce8d8a5..305c3c2 100644 --- a/pkg/etcd/etcd.go +++ b/pkg/etcd/etcd.go @@ -10,9 +10,9 @@ import ( "time" ) -const ( +var ( EndPoints = "ENDPOINTS" - EndAddress = "etcd:2379" + EndAddress = "etcd." + env.Namespace + ":2379" ) var ( @@ -40,7 +40,7 @@ func GetValue(key string) (string, error) { } kv := clientV3.NewKV(client) defer client.Close() - ctx, cancel := context.WithTimeout(context.TODO(), time.Minute*3) + ctx, cancel := context.WithTimeout(context.TODO(), time.Second*3) defer cancel() if getResp, err := kv.Get(ctx, key, clientV3.WithPrefix()); err == nil { if len(getResp.Kvs) > 0 {