feat 初始化
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.hlsq.asia/alex/service-common/db/etcd"
|
||||
"git.hlsq.asia/alex/service-common/log"
|
||||
"git.hlsq.asia/alex/service-common/utils"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"go.etcd.io/etcd/client/v3/concurrency"
|
||||
@@ -25,7 +24,6 @@ func (m *Snowflake) Init() error {
|
||||
}
|
||||
m.snowflakeSession = session
|
||||
utils.InitSnowflake(node)
|
||||
log.Infof("snowflake node: %v", node)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -41,7 +39,7 @@ func acquire(ctx context.Context, min, max int) (int64, *concurrency.Session, er
|
||||
}
|
||||
|
||||
for _, n := range nums {
|
||||
key := fmt.Sprintf("node/num/%d", n)
|
||||
key := fmt.Sprintf("/node/num/%d", n)
|
||||
|
||||
session, err := concurrency.NewSession(
|
||||
etcd.GetClient().Raw(),
|
||||
|
||||
Reference in New Issue
Block a user