mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #5714 from gyuho/wal_dir
*: use fileutil.TouchDirAll
This commit is contained in:
commit
23621387fc
@ -58,9 +58,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// owner can make/remove files inside the directory
|
|
||||||
privateDirMode = 0700
|
|
||||||
|
|
||||||
DefaultSnapCount = 10000
|
DefaultSnapCount = 10000
|
||||||
|
|
||||||
StoreClusterPrefix = "/0"
|
StoreClusterPrefix = "/0"
|
||||||
@ -246,7 +243,7 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
|
|||||||
|
|
||||||
haveWAL := wal.Exist(cfg.WALDir())
|
haveWAL := wal.Exist(cfg.WALDir())
|
||||||
|
|
||||||
if err = os.MkdirAll(cfg.SnapDir(), privateDirMode); err != nil && !os.IsExist(err) {
|
if err = fileutil.TouchDirAll(cfg.SnapDir()); err != nil {
|
||||||
plog.Fatalf("create snapshot directory error: %v", err)
|
plog.Fatalf("create snapshot directory error: %v", err)
|
||||||
}
|
}
|
||||||
ss := snap.New(cfg.SnapDir())
|
ss := snap.New(cfg.SnapDir())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user