debug Popular bet
continuous-integration/drone/push Build is passing Details

pull/13/head
luevard 11 months ago
parent 1c3fb9a7f3
commit b03bf7e121

@ -112,6 +112,7 @@ class PostgresBetDataSource(private val database: Database) : BetDataSource {
override fun getMostPopularBet(): Bet? { override fun getMostPopularBet(): Bet? {
val max=database.bets.filter { (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.maxBy { it.popularityscore } val max=database.bets.filter { (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.maxBy { it.popularityscore }
println(max)
if(max!=null){ if(max!=null){
return database.bets.filter { (it.popularityscore eq max) and (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.map { it.toBet(database) }.first() return database.bets.filter { (it.popularityscore eq max) and (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.map { it.toBet(database) }.first()
} }

Loading…
Cancel
Save