Skip to content

Commit

Permalink
Fix ~5min hang on server exit (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-The-Geek committed Feb 26, 2021
1 parent a0da3e4 commit 35d1f5d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/bot/impl/DiscordBotConnection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import net.minecraft.server.MinecraftServer
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
import net.minecraft.util.Util
import okhttp3.OkHttpClient
import okhttp3.Protocol

class DiscordBotConnection(private val config: Config) : BotConnection, ListenerAdapter() {

Expand All @@ -51,6 +53,9 @@ class DiscordBotConnection(private val config: Config) : BotConnection, Listener
this.webhookClient = WebhookClientBuilder(this.config[DiscordBotSpec.webhook])
.setDaemon(true)
.setAllowedMentions(allowedMentions)
.setHttpClient(OkHttpClient.Builder()
.protocols(listOf(Protocol.HTTP_1_1))
.build())
.build()
}
this.server = server
Expand Down

0 comments on commit 35d1f5d

Please sign in to comment.