File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/shared/akamai-edgeworker-sdk/src Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ class LDClient extends LDClientImpl {
34
34
this . _cacheableStoreProvider = storeProvider ;
35
35
}
36
36
37
+ override initialized ( ) : boolean {
38
+ return true ;
39
+ }
40
+
37
41
override waitForInitialization ( ) : Promise < LDClientType > {
38
42
// we need to resolve the promise immediately because Akamai's runtime doesnt
39
43
// have a setimeout so everything executes synchronously.
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import { EdgeProvider } from '.';
22
22
* - 10 for enterprise
23
23
*/
24
24
export default class CacheableStoreProvider implements EdgeProvider {
25
- cache : string | null | undefined ;
25
+ cache : Promise < string | null | undefined > | null | undefined ;
26
26
cachedAt : number | undefined ;
27
27
28
28
constructor (
@@ -38,10 +38,7 @@ export default class CacheableStoreProvider implements EdgeProvider {
38
38
*/
39
39
async get ( rootKey : string ) : Promise < string | null | undefined > {
40
40
if ( ! this . _isCacheValid ( ) ) {
41
- const updatedResults = await this . _edgeProvider . get ( rootKey ) ;
42
- if ( updatedResults !== undefined ) {
43
- this . cache = updatedResults ;
44
- }
41
+ this . cache = this . _edgeProvider . get ( rootKey ) ;
45
42
this . cachedAt = Date . now ( ) ;
46
43
}
47
44
You can’t perform that action at this time.
0 commit comments