Skip to content

Commit

Permalink
Added error logging for deleting local backup dir when restoring PIXL…
Browse files Browse the repository at this point in the history
…ISE env
  • Loading branch information
Peter Nemere committed Nov 7, 2024
1 parent b29dc64 commit 5a8c40d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/ws/wsHelpers/sync-mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ import (
)

func ResetLocalMongoBackupDir() error {
os.RemoveAll("./backup")
err := os.Mkdir("./backup", 0750)
err := os.RemoveAll("./backup")
if err != nil {
return fmt.Errorf("PIXLISE Backup failed to RemoveAll backup directory: %v", err)
}

err = os.Mkdir("./backup", 0750)
if err != nil {
return fmt.Errorf("PIXLISE Backup failed to create backup directory: %v", err)
}
Expand Down

0 comments on commit 5a8c40d

Please sign in to comment.