mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Delete temp file before running backup (#6248)
This commit is contained in:
@@ -322,6 +322,11 @@ func (s *Manager) BackupDatabase(download bool) (string, string, error) {
|
|||||||
backupPath = f.Name()
|
backupPath = f.Name()
|
||||||
backupName = s.Database.DatabaseBackupPath("")
|
backupName = s.Database.DatabaseBackupPath("")
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
|
// delete the temp file so that the backup operation can create it
|
||||||
|
if err := os.Remove(backupPath); err != nil {
|
||||||
|
return "", "", fmt.Errorf("could not remove temporary backup file %v: %w", backupPath, err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
backupDir := s.Config.GetBackupDirectoryPathOrDefault()
|
backupDir := s.Config.GetBackupDirectoryPathOrDefault()
|
||||||
if backupDir != "" {
|
if backupDir != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user