diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/QueryCommand.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/QueryCommand.kt b/src/main/kotlin/moe/nea/ledger/QueryCommand.kt index 305069a..71a57e1 100644 --- a/src/main/kotlin/moe/nea/ledger/QueryCommand.kt +++ b/src/main/kotlin/moe/nea/ledger/QueryCommand.kt @@ -79,9 +79,13 @@ class QueryCommand : CommandBase() { query.where(ANDExpression(value)) } query.limit(80u) + val dedup = mutableSetOf<UUIDUtil.ULIDWrapper>() query.forEach { val type = it[DBLogEntry.type] val transactionId = it[DBLogEntry.transactionId] + if (!dedup.add(transactionId)) { + return@forEach + } val timestamp = transactionId.getTimestamp() val items = DBItemEntry.selectAll(database.connection) .where(Clause { column(DBItemEntry.transactionId) eq string(transactionId.wrapped) }) |