diff options
| author | Christian Cleberg <[email protected]> | 2026-07-16 11:50:53 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-16 11:50:53 -0500 |
| commit | 0b6819d2d08b552e62fd236614d4c3c86a13394b (patch) | |
| tree | efb71f83c6dc62778ab01de9951cd229b50f348c /Hutch/Networking | |
| parent | 2b913e1b727429a3a6bc7eb023003ef2815919ae (diff) | |
| parent | f3c70e04148c57dcafead89b4e02b83e5f5635f8 (diff) | |
| download | hutch-3.8.1.tar.gz hutch-3.8.1.tar.bz2 hutch-3.8.1.zip | |
Merge pull request #8 from zerolabsco/phase-3-sonarcloud-housekeepingv3.8.1
v3.8.1: SonarCloud triage, forceRefresh fix, housekeeping
Diffstat (limited to 'Hutch/Networking')
| -rw-r--r-- | Hutch/Networking/ProjectService.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Hutch/Networking/ProjectService.swift b/Hutch/Networking/ProjectService.swift index 44320ca..91dc339 100644 --- a/Hutch/Networking/ProjectService.swift +++ b/Hutch/Networking/ProjectService.swift @@ -269,15 +269,15 @@ struct ProjectService: Sendable { self.client = client } - func fetchProjects() async throws -> [Project] { - try await fetchProjectSummaries().map(Self.makeSummaryProject) + func fetchProjects(forceRefresh: Bool = false) async throws -> [Project] { + try await fetchProjectSummaries(forceRefresh: forceRefresh).map(Self.makeSummaryProject) } func fetchProjectDetail(rid: String) async throws -> Project { try await fetchProjectDetailPayload(rid: rid) } - private func fetchProjectSummaries() async throws -> [ProjectSummaryPayload] { + private func fetchProjectSummaries(forceRefresh: Bool) async throws -> [ProjectSummaryPayload] { var results: [ProjectSummaryPayload] = [] var cursor: String? @@ -295,7 +295,7 @@ struct ProjectService: Sendable { cacheKey: APICacheKeys.projects(cursor: cursor), resourceType: .userProfile, ttl: APICacheTTLs.projectList, - policy: .cacheFirstThenRefresh + policy: forceRefresh ? .refreshIgnoringCache : .cacheFirstThenRefresh ) let response = cached.value |
