rm data dir creation block

This commit is contained in:
Erikas 2024-07-05 00:13:43 +03:00
parent e4eddc6d82
commit 25306bdc34

View File

@ -29,16 +29,18 @@ var (
func Start(c *Config) { func Start(c *Config) {
// Setup data dir // // Setup data dir //
_, err := os.Stat(c.DataDir) //// Commented out, otherwise In Docker it would throw 'panic: Failed to create data dir: mkdir "/data": no such file or directory'
if os.IsNotExist(err) { // _, err := os.Stat(c.DataDir)
err := os.Mkdir(c.DataDir, 0755) // if os.IsNotExist(err) {
if err != nil { // err := os.Mkdir(c.DataDir, 0755)
panic("Failed to create data dir: " + err.Error()) // if err != nil {
} // panic("Failed to create data dir: " + err.Error())
} else if err != nil { // }
panic("Failed to check data dir: " + err.Error()) // } else if err != nil {
} // panic("Failed to check data dir: " + err.Error())
// }
var err error
benchmarksDir = filepath.Join(c.DataDir, "benchmarks") benchmarksDir = filepath.Join(c.DataDir, "benchmarks")
_, err = os.Stat(benchmarksDir) _, err = os.Stat(benchmarksDir)
if os.IsNotExist(err) { if os.IsNotExist(err) {