Skip to content

Commit e68e9e4

Browse files
committedDec 27, 2024·
Refactor coroutine scope to include SupervisorJob
1 parent 29f6122 commit e68e9e4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎foxy/src/main/kotlin/net/cakeyfox/foxy/modules/welcomer/WelcomerManager.kt

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package net.cakeyfox.foxy.modules.welcomer
22

3-
import kotlinx.coroutines.CoroutineScope
4-
import kotlinx.coroutines.Dispatchers
5-
import kotlinx.coroutines.launch
6-
import kotlinx.coroutines.withContext
3+
import kotlinx.coroutines.*
74
import net.cakeyfox.foxy.FoxyInstance
85
import net.cakeyfox.foxy.modules.welcomer.utils.WelcomerWrapper
96
import net.cakeyfox.foxy.modules.welcomer.utils.WelcomerJSONParser
@@ -14,7 +11,7 @@ class WelcomerManager(
1411
val foxy: FoxyInstance
1512
) : WelcomerWrapper {
1613
private val welcomer = WelcomerJSONParser()
17-
private val scope = CoroutineScope(Dispatchers.IO)
14+
private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
1815

1916
override fun onGuildJoin(event: GuildMemberJoinEvent) {
2017
scope.launch {

0 commit comments

Comments
 (0)
Please sign in to comment.