Skip to content

Commit

Permalink
Adjust getRatesByIsinAndFilter, return all fields if filter is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Pozo committed Jul 21, 2024
1 parent 5d4a92c commit 59bd189
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ class SheetsService : SheetsAPI {
if(filter.endDate == null && filter.startDate == null && filter.attribute == null) {
RedisService.jedis.pipelined().use { pipeline ->
val results = RedisService.jedis.zrange("rate:keys#$isin", 0, -1).toList()
.map { pipeline.hget(it, RateHeaders.DATE.name.lowercase()) to pipeline.hget(it, attribute) }
.map { pipeline.hgetAll(it) }
pipeline.sync()
return results.stream()
.map {
mapOf<String, String>(
RateHeaders.DATE.name.lowercase() to it.first.get(),
attribute to it.second.get()
)
}
.toList()
return results.map { it.get()}
}
}
if (filter.startDate != null) {
Expand Down

0 comments on commit 59bd189

Please sign in to comment.