Skip to content

Commit

Permalink
FRI-567 Add check to code system upgrade to prevent "double" upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
QuyenLy87 committed Dec 2, 2022
1 parent 4f1d2f7 commit 3c490e6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public synchronized void upgrade(String id, CodeSystem codeSystem, Integer newDe
}
throw new IllegalArgumentException(errorMessage);
}
if (codeSystem.getDependantVersionEffectiveTime() != null && newDependantVersion.compareTo(codeSystem.getDependantVersionEffectiveTime()) <= 0) {
String errorMessage = "The new dependant version must be after the current dependant version.";
if (job != null) {
job.setStatus(CodeSystemUpgradeJob.UpgradeStatus.FAILED);
job.setErrorMessage(errorMessage);
}
throw new IllegalStateException(errorMessage);
}
CodeSystem parentCodeSystem = codeSystemService.findOneByBranchPath(parentPath);
if (parentCodeSystem == null) {
String errorMessage = String.format("The Code System to be upgraded must be on a branch which is the direct child of another Code System. " +
Expand Down

0 comments on commit 3c490e6

Please sign in to comment.