Create disco dir outside pilosa

This commit is contained in:
Kuba Podgórski 2021-01-15 12:30:57 +01:00
parent 684b20edb3
commit 64425736b0
2 changed files with 7 additions and 1 deletions

View file

@ -106,6 +106,7 @@ func (e *Etcd) Close() error {
e.e.Server.Stop()
e.e.Close()
<-e.e.Server.StopNotify()
// os.RemoveAll(e.options.Dir)
}
return nil

View file

@ -16,6 +16,7 @@ package test
import (
"fmt"
"io/ioutil"
"strings"
"time"
@ -40,6 +41,10 @@ func GenPortsConfig(ports []Ports) []*server.Config {
var lClientURL, lPeerURL string
lClientURL = fmt.Sprintf("http://localhost:%d", ports[i].Client)
lPeerURL = fmt.Sprintf("http://localhost:%d", ports[i].Peer)
discoDir := ""
if d, err := ioutil.TempDir("/tmp", "disco."); err == nil {
discoDir = d
}
cfgs[i] = &server.Config{
Gossip: gossip.Config{
@ -48,7 +53,7 @@ func GenPortsConfig(ports []Ports) []*server.Config {
BindGRPC: port.ColonZeroString(ports[i].Grpc),
DisCo: etcd.Options{
Name: name,
Dir: "",
Dir: discoDir,
ClusterName: "bartholemuuuuu",
LClientURL: lClientURL,
AClientURL: lClientURL,