mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-13 13:35:23 +01:00
Fix data directory creation
This commit is contained in:
parent
7543fd36e0
commit
003e66d841
1 changed files with 6 additions and 6 deletions
|
@ -81,6 +81,12 @@ func run() error {
|
|||
|
||||
logger.Infof("application initializing")
|
||||
|
||||
// Create the directories if they don't exist
|
||||
if err := os.MkdirAll(cfg.Data.Path, 0755); err != nil {
|
||||
logger.WithError(err).Error("error creating data directory")
|
||||
return fmt.Errorf("creating data directory: %w", err)
|
||||
}
|
||||
|
||||
// Start Database
|
||||
logger.Println("initializing database support")
|
||||
dbconn, err := sql.Open("sqlite3", cfg.DB.Filename)
|
||||
|
@ -121,12 +127,6 @@ func run() error {
|
|||
return fmt.Errorf("creating the API server instance: %w", err)
|
||||
}
|
||||
|
||||
// Create the directories if they don't exist
|
||||
if err := os.MkdirAll(cfg.Data.Path, 0755); err != nil {
|
||||
logger.WithError(err).Error("error creating data directory")
|
||||
return fmt.Errorf("creating data directory: %w", err)
|
||||
}
|
||||
|
||||
|
||||
router := apirouter.Handler()
|
||||
|
||||
|
|
Loading…
Reference in a new issue