From 421d27593d537a104c825e0e7120200175287e07 Mon Sep 17 00:00:00 2001 From: Laurent Luce Date: Mon, 15 Apr 2024 14:25:03 -0400 Subject: [PATCH] fix: Use instance `updated at` attribute for uptime calculation (#2378) ## Description An instance `created at` time is the time when it is added to the pool. We need to use the `updated at` time which is the time when the instance is reassigned to the user and set to running. ## Is this change user facing? YES ## References (if applicable) https://github.com/kurtosis-tech/kurtosis-cloud-backend/pull/157 --- .../app/src/emui/enclaves/components/InstanceTermination.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enclave-manager/web/packages/app/src/emui/enclaves/components/InstanceTermination.tsx b/enclave-manager/web/packages/app/src/emui/enclaves/components/InstanceTermination.tsx index e4332d24c2..4552a2057f 100644 --- a/enclave-manager/web/packages/app/src/emui/enclaves/components/InstanceTermination.tsx +++ b/enclave-manager/web/packages/app/src/emui/enclaves/components/InstanceTermination.tsx @@ -20,7 +20,7 @@ export const InstanceTerminationWarning = () => { const fetchCloudInstanceCreationTime = async () => { try { const cloudInstanceConfigResponse = await kurtosisClient.getCloudInstanceConfig(); - const upTime = Math.floor((Date.now() - new Date(cloudInstanceConfigResponse.created).getTime()) / (3600 * 1000)); + const upTime = Math.floor((Date.now() - new Date(cloudInstanceConfigResponse.updated).getTime()) / (3600 * 1000)); const remainingHours = KURTOSIS_CLOUD_INSTANCE_MAX_UPTIME_IN_HOURS - upTime - 1; setCloudInstanceRemainingHours(remainingHours); } catch (error) {