mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix usage of new asyncComputed type
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
f2d19e7d43
commit
2a96eb82f8
@ -18,10 +18,13 @@ const shellEnvironmentCacheInjectable = getInjectable({
|
|||||||
const cache = new Map<ClusterId, IAsyncComputed<Partial<Record<string, string>>>>();
|
const cache = new Map<ClusterId, IAsyncComputed<Partial<Record<string, string>>>>();
|
||||||
|
|
||||||
return async (clusterId, builder) => {
|
return async (clusterId, builder) => {
|
||||||
const cacheLine = getOrInsert(cache, clusterId, asyncComputed(() => {
|
const cacheLine = getOrInsert(cache, clusterId, asyncComputed({
|
||||||
|
getValueFromObservedPromise: async () => {
|
||||||
now(1000 * 60 * 10); // update every 10 minutes
|
now(1000 * 60 * 10); // update every 10 minutes
|
||||||
|
|
||||||
return builder();
|
return builder();
|
||||||
|
},
|
||||||
|
betweenUpdates: "show-latest-value",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await when(() => !cacheLine.pending.get());
|
await when(() => !cacheLine.pending.get());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user