Skip to content

Commit 1c2841d

Browse files
committed
Remove redundant runBlocking
1 parent f962973 commit 1c2841d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/components/builder/ITimeoutableComponent.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import io.github.freya022.botcommands.api.parameters.resolvers.TimeoutParameterR
1313
import io.github.freya022.botcommands.internal.utils.annotationRef
1414
import io.github.freya022.botcommands.internal.utils.javaMethodInternal
1515
import io.github.freya022.botcommands.internal.utils.throwArgument
16-
import kotlinx.coroutines.runBlocking
1716
import java.time.Duration as JavaDuration
1817
import java.util.concurrent.TimeUnit
1918
import javax.annotation.CheckReturnValue
@@ -409,7 +408,7 @@ interface IEphemeralTimeoutableComponent<T : IEphemeralTimeoutableComponent<T>>
409408
*/
410409
@CheckReturnValue
411410
fun timeout(timeout: Long, timeoutUnit: TimeUnit, handler: Runnable): T =
412-
timeout(timeout.toDuration(timeoutUnit.toDurationUnit())) { runBlocking { handler.run() } }
411+
timeout(timeout.toDuration(timeoutUnit.toDurationUnit())) { handler.run() }
413412

414413
/**
415414
* Sets the timeout on this component, invalidating the component on expiration,

0 commit comments

Comments
 (0)