mirror of
https://github.com/pikami/cosmium.git
synced 2026-11-01 05:55:36 +00:00
Fix issues with persist flag; Use custom logger for badger
This commit is contained in:
1 parent
28e3c0c3d8
commit
598f2837af
3 files changed
+36
-2
No files matched your search
@@ -77,8 +77,13 @@ func (c *ServerConfig) PopulateCalculatedFields() {
|
||||
logger.SetLogLevel(logger.LogLevelInfo)
|
||||
}
|
||||
|
||||
if c.PersistDataFilePath != "" {
|
||||
fileInfo, _ := os.Stat(c.PersistDataFilePath)
|
||||
fileInfo, err := os.Stat(c.PersistDataFilePath)
|
||||
if c.PersistDataFilePath != "" && !os.IsNotExist(err) {
|
||||
if err != nil {
|
||||
logger.ErrorLn("Failed to get file info for persist path:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if c.DataStore == DataStoreJson && fileInfo.IsDir() {
|
||||
logger.ErrorLn("--Persist cannot be a directory when using json data store")
|
||||
os.Exit(1)
|
||||
|
||||
Reference in new issue
Block a user