Skip to content

Commit

Permalink
Ensure that only single result is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Burman authored and John Sanda committed May 26, 2015
1 parent 19613fd commit 80d0f27
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ public Observable<BucketedOutput<AvailabilityBucketDataPoint>> findAvailabilityS
public Observable<Boolean> idExists(final String id) {
return dataAccess.findAllGaugeMetrics().flatMap(Observable::from)
.filter(row -> id.equals(row.getString(2)))
.take(1)
.map(r -> Boolean.TRUE)
.defaultIfEmpty(Boolean.FALSE);
}
Expand Down

0 comments on commit 80d0f27

Please sign in to comment.