Skip to content

Commit

Permalink
Add constant for fallback cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gosusnp authored and krishnaglick committed Dec 12, 2022
1 parent c7e8579 commit 8f4b2d5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
@Slf4j
public class WebBackendCheckUpdatesHandler {

private static final int NO_CHANGES_FOUND = 0;

final ConfigRepository configRepository;
final AirbyteGithubStore githubStore;

Expand All @@ -46,7 +48,7 @@ private int getDestinationDiffCount() {
.toList();
} catch (final IOException e) {
log.error("Failed to get current list of standard destination definitions", e);
return 0;
return NO_CHANGES_FOUND;
}

try {
Expand All @@ -55,7 +57,7 @@ private int getDestinationDiffCount() {
.collect(Collectors.toMap(StandardDestinationDefinition::getDestinationDefinitionId, StandardDestinationDefinition::getDockerImageTag));
} catch (final InterruptedException e) {
log.error("Failed to get latest list of standard destination definitions", e);
return 0;
return NO_CHANGES_FOUND;
}

return getDiffCount(currentActorDefToDockerImageTag, newActorDefToDockerImageTag);
Expand All @@ -72,7 +74,7 @@ private int getSourceDiffCount() {
.toList();
} catch (final IOException e) {
log.error("Failed to get current list of standard source definitions", e);
return 0;
return NO_CHANGES_FOUND;
}

try {
Expand All @@ -81,7 +83,7 @@ private int getSourceDiffCount() {
.collect(Collectors.toMap(StandardSourceDefinition::getSourceDefinitionId, StandardSourceDefinition::getDockerImageTag));
} catch (final InterruptedException e) {
log.error("Failed to get latest list of standard source definitions", e);
return 0;
return NO_CHANGES_FOUND;
}

return getDiffCount(currentActorDefToDockerImageTag, newActorDefToDockerImageTag);
Expand Down

0 comments on commit 8f4b2d5

Please sign in to comment.