mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
fix(server): backup and restore issues from the cli (#3579)
* fix(server): backup not working from cli Signed-off-by: Deluan <deluan@navidrome.org> * fix(server): make backup-file required for restore Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
630c304080
commit
0299e488b5
2 changed files with 8 additions and 8 deletions
12
db/backup.go
12
db/backup.go
|
@ -34,18 +34,18 @@ func backupPath(t time.Time) string {
|
|||
|
||||
func backupOrRestore(ctx context.Context, isBackup bool, path string) error {
|
||||
// heavily inspired by https://codingrabbits.dev/posts/go_and_sqlite_backup_and_maybe_restore/
|
||||
backupDb, err := sql.Open(Driver, path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer backupDb.Close()
|
||||
|
||||
existingConn, err := Db().Conn(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer existingConn.Close()
|
||||
|
||||
backupDb, err := sql.Open(Driver, path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer backupDb.Close()
|
||||
|
||||
backupConn, err := backupDb.Conn(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue