feat config
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
)
|
||||
|
||||
// NewLeaseAndKeepAlive 创建租约并保活
|
||||
func NewLeaseAndKeepAlive(ttl int64) (clientv3.LeaseID, error) {
|
||||
lease, err := etcd.Client().Grant(context.Background(), ttl)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user