Skip to content

Commit

Permalink
Fix sorting in detailed mongodb backup list
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Khurtin committed Sep 14, 2022
1 parent 71fb7e9 commit 98f1b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/databases/mongo/backup_list_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func HandleDetailedBackupList(folder storage.Folder, output io.Writer, pretty, j
}

sort.Slice(backupDetails, func(i, j int) bool {
return backupDetails[i].FinishLocalTime.After(backupDetails[j].FinishLocalTime)
return backupDetails[i].FinishLocalTime.Before(backupDetails[j].FinishLocalTime)
})

switch {
Expand Down
4 changes: 3 additions & 1 deletion internal/databases/mongo/binary/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ func (backupService *BackupService) DoBackup(backupName string, permanent bool)
defer func() {
if err != nil {
closeErr := backupCursor.Close(backupService.Context)
tracelog.ErrorLogger.Printf("Unable to close backup cursor: %+v", closeErr)
if closeErr != nil {
tracelog.ErrorLogger.Printf("Unable to close backup cursor: %+v", closeErr)
}
}
}()

Expand Down

0 comments on commit 98f1b0d

Please sign in to comment.