@@ -44,7 +44,7 @@ final class RemoteSettings: SettingsProvider, Sendable {
44
44
45
45
private var sessionsCache : [ String : Any ] {
46
46
cache. withLock { cache in
47
- return cache. cacheContent [ RemoteSettings . flagSessionsCache] as? [ String : Any ] ?? [ : ]
47
+ cache. cacheContent [ RemoteSettings . flagSessionsCache] as? [ String : Any ] ?? [ : ]
48
48
}
49
49
}
50
50
@@ -65,23 +65,22 @@ final class RemoteSettings: SettingsProvider, Sendable {
65
65
}
66
66
}
67
67
68
- downloader. fetch { result in
69
-
70
- switch result {
71
- case let . success( dictionary) :
72
- self . cache. withLock { cache in
73
- // Saves all newly fetched Settings to cache
74
- cache. cacheContent = dictionary
75
- // Saves a "cache-key" which carries TTL metadata about current cache
76
- cache. cacheKey = CacheKey (
77
- createdAt: currentTime,
78
- googleAppID: self . appInfo. appID,
79
- appVersion: self . appInfo. synthesizedVersion
80
- )
81
- }
68
+ downloader. fetch { result in
69
+
70
+ switch result {
71
+ case let . success( dictionary) :
72
+ self . cache. withLock { cache in
73
+ // Saves all newly fetched Settings to cache
74
+ cache. cacheContent = dictionary
75
+ // Saves a "cache-key" which carries TTL metadata about current cache
76
+ cache. cacheKey = CacheKey (
77
+ createdAt: currentTime,
78
+ googleAppID: self . appInfo. appID,
79
+ appVersion: self . appInfo. synthesizedVersion
80
+ )
81
+ }
82
82
case let . failure( error) :
83
83
Logger . logError ( " [Settings] Fetching newest settings failed with error: \( error) " )
84
-
85
84
}
86
85
}
87
86
}
@@ -114,7 +113,7 @@ extension RemoteSettingsConfigurations {
114
113
115
114
func isSettingsStale( ) -> Bool {
116
115
cache. withLock { cache in
117
- return isCacheExpired ( cache, time: Date ( ) )
116
+ isCacheExpired ( cache, time: Date ( ) )
118
117
}
119
118
}
120
119
0 commit comments