Ignore errors on duplicate uuid loging event
This commit is contained in:
parent
63fea6a7aa
commit
d03d150a76
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.sql.ResultRow
|
||||||
import org.jetbrains.exposed.sql.insert
|
import org.jetbrains.exposed.sql.insert
|
||||||
|
import org.jetbrains.exposed.sql.insertIgnore
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.sql.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
@ -30,7 +31,7 @@ class LoginEventDao {
|
||||||
|
|
||||||
suspend fun addLoginEvent(event: LoginEvent) = withContext(Dispatchers.IO) {
|
suspend fun addLoginEvent(event: LoginEvent) = withContext(Dispatchers.IO) {
|
||||||
transaction {
|
transaction {
|
||||||
LoginEvents.insert {
|
LoginEvents.insertIgnore {
|
||||||
it[uuid] = event.uuid
|
it[uuid] = event.uuid
|
||||||
it[schoolName] = event.schoolName
|
it[schoolName] = event.schoolName
|
||||||
it[schoolShort] = event.schoolShort
|
it[schoolShort] = event.schoolShort
|
||||||
|
|
Loading…
Reference in a new issue