Skip to content

Commit

Permalink
refactor(backup): use existing comparator
Browse files Browse the repository at this point in the history
Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
  • Loading branch information
deepthidevaki and oleschoenburg committed May 3, 2023
1 parent 8763717 commit cbb2d5e
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -79,8 +79,7 @@ private void takeBackupIfDoesNotExist(
final BackupStatusCode existingBackupStatus =
availableBackups.isEmpty()
? BackupStatusCode.DOES_NOT_EXIST
: Collections.max(availableBackups, Comparator.comparing(BackupStatus::statusCode))
.statusCode();
: Collections.max(availableBackups, BackupStatusCode.BY_STATUS).statusCode();
switch (existingBackupStatus) {
case COMPLETED -> {
LOG.debug("Backup {} is already completed, will not take a new one", inProgressBackup.id());
Expand Down

0 comments on commit cbb2d5e

Please sign in to comment.