mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 01:10:44 +00:00
Fix issues with persist flag; Use custom logger for badger
This commit is contained in:
@@ -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