diff --git a/README-zh-hans.md b/README-zh-hans.md index 78a5158..a2c4358 100644 --- a/README-zh-hans.md +++ b/README-zh-hans.md @@ -1,6 +1,7 @@ # slock -[![Build Status](https://travis-ci.com/snower/slock.svg?branch=master)](https://travis-ci.com/snower/slock) +[![Tests](https://img.shields.io/github/actions/workflow/status/snower/slock/build-test.yml?label=tests)](https://github.com/snower/slock/actions/workflows/build-test.yml) +[![GitHub Repo stars](https://img.shields.io/github/stars/snower/slock?style=social)](https://github.com/snower/slock/stargazers) 高性能分布式状态同步与原子操作数据库。 diff --git a/README.md b/README.md index f33a552..2565f85 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # slock -[![Build Status](https://travis-ci.com/snower/slock.svg?branch=master)](https://travis-ci.com/snower/slock) +[![Tests](https://img.shields.io/github/actions/workflow/status/snower/slock/build-test.yml?label=tests)](https://github.com/snower/slock/actions/workflows/build-test.yml) +[![GitHub Repo stars](https://img.shields.io/github/stars/snower/slock?style=social)](https://github.com/snower/slock/stargazers) High-performance distributed sync service and atomic DB diff --git a/server/aof.go b/server/aof.go index 83eceb1..fb136d2 100644 --- a/server/aof.go +++ b/server/aof.go @@ -1147,7 +1147,10 @@ func (self *Aof) Init() ([16]byte, error) { self.dataDir = dataDir if _, serr := os.Stat(self.dataDir); os.IsNotExist(serr) { - return [16]byte{}, serr + err = os.Mkdir(self.dataDir, 0755) + if err != nil { + return [16]byte{}, serr + } } self.slock.Log().Infof("Aof config data dir %s", self.dataDir) @@ -1192,7 +1195,10 @@ func (self *Aof) LoadAndInit() error { self.dataDir = dataDir if _, serr := os.Stat(self.dataDir); os.IsNotExist(serr) { - return serr + err = os.Mkdir(self.dataDir, 0755) + if err != nil { + return serr + } } self.slock.Log().Infof("Aof config data dir %s", self.dataDir)