Skip to content

Commit

Permalink
feat: limit the amount of requested results to 1 in order to reduce p…
Browse files Browse the repository at this point in the history
…otential database overhead
  • Loading branch information
GiantTreeLP committed Nov 22, 2023
1 parent ec4b9b0 commit bc27226
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/de/gianttree/discord/w2g/database/guild.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ object Guilds : SnowflakeIdTable() {

// SELECT * FROM guilds WHERE last_update = minSelect AND active = true
val resultSet =
Guilds.select { (lastUpdate eqSubQuery minSelect) and (active eq true) }.firstOrNull() ?: return null
Guilds.select { (lastUpdate eqSubQuery minSelect) and (active eq true) }.limit(1).firstOrNull()
?: return null

return Guild.wrapRow(resultSet)
}
Expand Down

0 comments on commit bc27226

Please sign in to comment.