1
0
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:
Sebastian Malton 2022-10-28 09:54:20 -04:00
parent f2d19e7d43
commit 2a96eb82f8

View File

@ -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({
now(1000 * 60 * 10); // update every 10 minutes getValueFromObservedPromise: async () => {
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());