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>
(cherry picked from commit 65e08d9)
  • Loading branch information
deepthidevaki committed May 4, 2023
1 parent 36899fb commit eaff494
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.camunda.zeebe.scheduler.future.CompletableActorFuture;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
Expand Down Expand Up @@ -81,8 +80,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 eaff494

Please sign in to comment.