fix backend
This commit is contained in:
@@ -6,7 +6,6 @@ import org.koin.core.annotation.Single
|
||||
import ru.shadowsparky.backend.data.EnvFetcher
|
||||
import ru.shadowsparky.backend.domain.JwtInfo
|
||||
import ru.shadowsparky.vbox.backend.di.DbModule
|
||||
import ru.shadowsparky.vbox.backend.di.EventModule
|
||||
import ru.shadowsparky.vbox.backend.di.HttpModule
|
||||
|
||||
@Module
|
||||
@@ -27,7 +26,6 @@ class VboxModule {
|
||||
includes = [
|
||||
DbModule::class,
|
||||
HttpModule::class,
|
||||
EventModule::class,
|
||||
VboxModule::class
|
||||
]
|
||||
)
|
||||
|
||||
+7
-2
@@ -22,11 +22,16 @@ class SessionVideoApi(private val wrapper: VideoApi) : VideoApi {
|
||||
private val linksMutex = Mutex()
|
||||
|
||||
override suspend fun fetchNewVideos(query: String?): VideosResponse {
|
||||
val cacheKey = query ?: ""
|
||||
val cacheKey = query.orEmpty()
|
||||
videosCache.getValid(cacheKey)?.let { return it }
|
||||
return videosMutex.withLock {
|
||||
videosCache.getValid(cacheKey) ?: run {
|
||||
val remoteData = wrapper.fetchNewVideos(query)
|
||||
var remoteData = wrapper.fetchNewVideos(query)
|
||||
remoteData = if (remoteData == videosCache[""]?.data) {
|
||||
VideosResponse(false, emptyList(), 1)
|
||||
} else {
|
||||
remoteData
|
||||
}
|
||||
videosCache[cacheKey] = CacheEntry(remoteData)
|
||||
remoteData
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package ru.shadowsparky.vbox.backend.di
|
||||
|
||||
import org.koin.core.annotation.Module
|
||||
|
||||
@Module
|
||||
class EventModule {
|
||||
|
||||
|
||||
}
|
||||
@@ -68,6 +68,5 @@
|
||||
<string name="movie_tags_empty">Настроить теги</string>
|
||||
<string name="user_tags_filter_disable">Не фильтровать</string>
|
||||
<string name="check_for_updates">Поиск обновлений</string>
|
||||
<string name="chat_title_app_bar">Братан СвинGPT</string>
|
||||
<string name="chat_title">СвинGPT</string>
|
||||
<string name="chat_title_app_bar">СвинGPT</string>
|
||||
</resources>
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ class HttpClientSettings(
|
||||
}
|
||||
}
|
||||
install(Logging) {
|
||||
val isDebug = koin.getOrNull<AppConfig>()?.debug ?: true
|
||||
val isDebug = koin.getOrNull<AppConfig>()?.debug ?: false
|
||||
if (isDebug) {
|
||||
this.level = LogLevel.ALL
|
||||
this.logger = object : Logger {
|
||||
|
||||
Reference in New Issue
Block a user