Skip to content

Commit

Permalink
log unpublished matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed Dec 17, 2024
1 parent c30e6cc commit 967ede1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,24 @@ private void runExportForMaskIds(int jobId, List<String> maskMipIds) {
this::updateLMNeuron,
indexedNeuronURLs
))
.filter(resultMatches -> resultMatches.getKey().isPublished()) // filter out unpublished EMs
.filter(resultMatches -> {
if (resultMatches.getKey().isUnpublished()) {
LOG.warn("Ignore matches for neuron {} - it was unpublished because: {}",
resultMatches.getKey(), resultMatches.getKey().getUnpublishReasons());
return false;
}
return true;
}) // filter out unpublished EMs
.peek(resultMatches -> resultMatches.setItems(resultMatches.getItems().stream()
// filter out unpublished LMs
.filter(m -> m.getTargetImage().isPublished())
.filter(m -> {
if (m.getTargetImage().isUnpublished()) {
LOG.warn("Removed match {} for {} - {} was unpublished because: {}", m, resultMatches.getKey(),
m.getTargetImage(), m.getTargetImage().getUnpublishReasons());
return false;
}
return true;
})
// filter out matches that do not have uploaded files
.filter(m -> m.hasMatchFile(FileType.CDMInput) && m.hasMatchFile(FileType.CDMMatch))
.collect(Collectors.toList())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,24 @@ private void runExportForTargetIds(int jobId, List<String> targetMipIds) {
this::updateEMNeuron,
indexedNeuronURLs
))
.filter(resultMatches -> resultMatches.getKey().isPublished()) // filter out unpublished LMs
.filter(resultMatches -> {
if (resultMatches.getKey().isUnpublished()) {
LOG.warn("Ignore matches for neuron {} - it was unpublished because: {}",
resultMatches.getKey(), resultMatches.getKey().getUnpublishReasons());
return false;
}
return true;
}) // filter out unpublished LMs
.peek(resultMatches -> resultMatches.setItems(resultMatches.getItems().stream()
// filter out unpublished EMs
.filter(m -> m.getTargetImage().isPublished())
.filter(m -> {
if (m.getTargetImage().isUnpublished()) {
LOG.warn("Removed match {} for {} - {} was unpublished because: {}", m, resultMatches.getKey(),
m.getTargetImage(), m.getTargetImage().getUnpublishReasons());
return false;
}
return true;
})
// filter out matches that do not have uploaded files
.filter(m -> m.hasMatchFile(FileType.CDMInput) && m.hasMatchFile(FileType.CDMMatch))
.collect(Collectors.toList())))
Expand Down

0 comments on commit 967ede1

Please sign in to comment.