Skip to content

Commit

Permalink
chore: refactors / addresses pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagotnunes committed Jan 28, 2021
1 parent d9d3cc6 commit d6a45d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Expand Up @@ -100,7 +100,7 @@ public Builder setExpireTime(Timestamp expireTime) {

@Override
public Builder setVersionTime(Timestamp versionTime) {
this.versionTime = Preconditions.checkNotNull(versionTime);
this.versionTime = versionTime;
return this;
}

Expand Down
Expand Up @@ -119,16 +119,13 @@ public OperationFuture<Backup, CreateBackupMetadata> backup(Backup backup) {
backup.getInstanceId().equals(getId().getInstanceId()),
"The instance of the backup must be equal to the instance of this database.");

final BackupInfo.Builder backupBuilder =
return dbClient.createBackup(
dbClient
.newBackupBuilder(backup.getId())
.setDatabase(getId())
.setExpireTime(backup.getExpireTime());
if (backup.getVersionTime() != null) {
backupBuilder.setVersionTime(backup.getVersionTime());
}

return dbClient.createBackup(backupBuilder.build());
.setExpireTime(backup.getExpireTime())
.setVersionTime(backup.getVersionTime())
.build());
}

/**
Expand Down

0 comments on commit d6a45d0

Please sign in to comment.