fixes in build

This commit is contained in:
InsanusMokrassar 2022-07-30 23:25:38 +06:00
parent a7814c61b5
commit 62a10b9042

View File

@ -41,17 +41,10 @@ class AdminsPlugin : Plugin {
override suspend fun BehaviourContext.setupBotPlugin(koin: Koin) { override suspend fun BehaviourContext.setupBotPlugin(koin: Koin) {
with(koin) { with(koin) {
when (chatsSettings) { mutex.withLock {
null -> { val flow = databaseToAdminsCacheAPI.getOrPut(koin.get()){ MutableStateFlow(null) }
mutex.withLock { if (flow.value == null) {
val flow = databaseToAdminsCacheAPI.getOrPut(koin.get()){ MutableStateFlow(null) } flow.value = AdminsCacheAPI(koin.get())
if (flow.value == null) {
flow.value = AdminsCacheAPI(koin.get())
}
}
}
else -> mutex.withLock {
globalAdminsCacheAPI.value = AdminsCacheAPI(koin.get())
} }
} }
} }