Skip to content

Commit

Permalink
Fix: sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandragi committed Sep 6, 2024
1 parent ca802cd commit a1bfa79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sonar {
}

tasks.register("copyJar") {
description = "Copy jar to server location"
group = "fardragi"
dependsOn("build")
doLast() {
Expand All @@ -27,6 +28,7 @@ tasks.register("copyJar") {
}

tasks.register<Exec>("startServer") {
description = "Run minecraft server"
group = "fardragi"
standardInput = System.`in`
dependsOn("copyJar")
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/fardragi/nyaruko/database/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.fardragi.nyaruko.database

import com.fardragi.nyaruko.NyarukoLog
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.jetbrains.exposed.sql.SqlLogger
Expand All @@ -17,7 +18,7 @@ object CustomLogger : SqlLogger {
}
}

suspend fun <T> query(block: () -> T): T = withContext(Dispatchers.IO) {
suspend fun <T> query(block: () -> T, dispatcher: CoroutineDispatcher = Dispatchers.IO): T = withContext(dispatcher) {
transaction {
addLogger(CustomLogger)
block()
Expand Down

0 comments on commit a1bfa79

Please sign in to comment.