Skip to content

Commit

Permalink
Change PackageSearchApiClient to use default endpoints
Browse files Browse the repository at this point in the history
The PackageSearchApiClient within the PackageSearchApplicationCachesService is updated to use the DEFAULT endpoints from PackageSearchEndpoints instead of the DEV endpoints. This change doesn't affect the behavior of the application but makes the code more consistent and easier to read.
  • Loading branch information
lamba92 committed Jan 9, 2024
1 parent 1f8e882 commit faf3693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class PackageSearchApplicationCachesService(private val coroutineScope: Coroutin
private val repositoryCache
get() = getRepository<ApiRepositoryCacheEntry>("repositories")

private val devApiClient = PackageSearchApiClient(
endpoints = PackageSearchEndpoints.DEV,
private val apiClient = PackageSearchApiClient(
endpoints = PackageSearchEndpoints.DEFAULT,
httpClient = PackageSearchApiClient.defaultHttpClient {
install(Logging) {
level = LogLevel.ALL
Expand All @@ -86,13 +86,13 @@ class PackageSearchApplicationCachesService(private val coroutineScope: Coroutin
}
)

val isOnlineFlow = devApiClient.isOnlineFlow()
val isOnlineFlow = apiClient.isOnlineFlow()
.stateIn(coroutineScope, SharingStarted.WhileSubscribed(), true)

val apiPackageCache = PackageSearchApiPackageCache(
apiPackageCache = packagesRepository,
searchCache = searchesRepository,
apiClient = devApiClient
apiClient = apiClient
)

private suspend fun createIndexes() {
Expand Down

0 comments on commit faf3693

Please sign in to comment.