Fix deploy and storage path

This commit is contained in:
2025-08-14 14:26:38 +03:00
parent df069a9aa1
commit a1c394ba89
5 changed files with 11 additions and 15 deletions

10
main.go
View File

@@ -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)
}