From 2a96eb82f839e42b35b6bcb8edd1769de8e6acec Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 28 Oct 2022 09:54:20 -0400 Subject: [PATCH] Fix usage of new asyncComputed type Signed-off-by: Sebastian Malton --- .../shell-session/shell-environment-cache.injectable.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/shell-session/shell-environment-cache.injectable.ts b/src/main/shell-session/shell-environment-cache.injectable.ts index 0e13d03bda..91301f0e53 100644 --- a/src/main/shell-session/shell-environment-cache.injectable.ts +++ b/src/main/shell-session/shell-environment-cache.injectable.ts @@ -18,10 +18,13 @@ const shellEnvironmentCacheInjectable = getInjectable({ const cache = new Map>>>(); 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());