Fix usage of new asyncComputed type

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-01-10 15:18:10 -05:00
1 parent f2d19e7d43
commit 2a96eb82f8
1 file changed
+6 -3
@@ -18,10 +18,13 @@ const shellEnvironmentCacheInjectable = getInjectable({
const cache = new Map<ClusterId, IAsyncComputed<Partial<Record<string, string>>>>();
return async (clusterId, builder) => {
const cacheLine = getOrInsert(cache, clusterId, asyncComputed(() => {
now(1000 * 60 * 10); // update every 10 minutes
const cacheLine = getOrInsert(cache, clusterId, asyncComputed({
getValueFromObservedPromise: async () => {
now(1000 * 60 * 10); // update every 10 minutes
return builder();
return builder();
},
betweenUpdates: "show-latest-value",
}));
await when(() => !cacheLine.pending.get());