Fix deploy and storage path
This commit is contained in:
10
main.go
10
main.go
@@ -52,10 +52,8 @@ func main() {
|
||||
// Load configuration
|
||||
cfg, err := config.LoadConfig(*configPath)
|
||||
if err != nil {
|
||||
// If config file doesn't exist, use defaults
|
||||
cfg = config.DefaultConfig()
|
||||
// Log that we're using default config
|
||||
logger.Info("Using default configuration", "config_path", *configPath, "error", err)
|
||||
logger.Error("Unable to load configuration", "config_path", *configPath, "error", err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
logger.Info("Configuration loaded successfully", "config_path", *configPath)
|
||||
}
|
||||
@@ -66,8 +64,8 @@ func main() {
|
||||
}
|
||||
|
||||
// Создаем директории если они не существуют
|
||||
if err := os.MkdirAll("data/files", 0755); err != nil {
|
||||
logger.Error("Failed to create data/files directory", "error", err)
|
||||
if err := os.MkdirAll(cfg.Storage.Path, 0750); err != nil {
|
||||
logger.Error("Failed to create file storage directory", "path", cfg.Storage.Path, "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user