File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Modules/Sources/Yosemite/Tools/POS Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,23 @@ public actor POSLocalCatalogEligibilityService: POSLocalCatalogEligibilityServic
5050 }
5151
5252 /// Fetch and cache the remote feature flag value
53+ /// Returns cached value if available, otherwise returns true without waiting for network
5354 private func isRemoteCatalogFeatureFlagEnabled( ) async -> Bool {
5455 if let cached = cachedRemoteFeatureFlag {
5556 return cached
5657 }
57- let value = await remoteFeatureFlagProvider ( )
58+ // No cached value yet - assume eligible (true) without waiting for network
59+ // Kick off the fetch in the background to cache for next time
60+ Task { [ weak self] in
61+ let value = await self ? . remoteFeatureFlagProvider ( ) ?? true
62+ await self ? . cacheRemoteFeatureFlag ( value)
63+ }
64+ return true
65+ }
66+
67+ /// Cache the remote feature flag value (actor-isolated)
68+ private func cacheRemoteFeatureFlag( _ value: Bool ) {
5869 cachedRemoteFeatureFlag = value
59- return value
6070 }
6171
6272 /// Update POS eligibility and refresh catalog eligibility for the specified site
You can’t perform that action at this time.
0 commit comments