Skip to content

Commit

Permalink
Rename property; Update its kdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkup committed Jan 7, 2025
1 parent 7a9fc1e commit 204a402
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ class CollectionListRefresher @AssistedInject constructor(


/**
* The HttpUrls which have been fetched already during a single refresh.
* The HttpUrls which have been saved to database already during a single refresh and will be
* queried later.
*/
private val alreadyFetched = mutableSetOf<HttpUrl>()
private val alreadySaved = mutableSetOf<HttpUrl>()

/**
* The HttpUrls which have been queried already during a single refresh.
Expand Down Expand Up @@ -118,7 +119,7 @@ class CollectionListRefresher @AssistedInject constructor(
for (homeSetHref in homeSets.hrefs)
principal.location.resolve(homeSetHref)?.let { homesetUrl ->
val resolvedHomeSetUrl = UrlUtils.withTrailingSlash(homesetUrl)
if (!alreadyFetched.contains(resolvedHomeSetUrl)) {
if (!alreadySaved.contains(resolvedHomeSetUrl)) {
homeSetRepository.insertOrUpdateByUrl(
// HomeSet is considered personal if this is the outer recursion call,
// This is because we assume the first call to query the current-user-principal
Expand All @@ -127,7 +128,7 @@ class CollectionListRefresher @AssistedInject constructor(
// and an owned home set need not always be personal either.
HomeSet(0, service.id, personal, resolvedHomeSetUrl)
)
alreadyFetched += resolvedHomeSetUrl
alreadySaved += resolvedHomeSetUrl
}
}
}
Expand Down

0 comments on commit 204a402

Please sign in to comment.