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 65e08d9
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -16,7 +16,6 @@
import io.camunda.zeebe.scheduler.future.ActorFuture;
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 @@ -79,8 +78,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 65e08d9

Please sign in to comment.