@@ -147,7 +147,7 @@ Index: sagemaker-code-editor/vscode/extensions/sagemaker-idle-extension/src/exte
147147===================================================================
148148--- /dev/null
149149+++ sagemaker-code-editor/vscode/extensions/sagemaker-idle-extension/src/extension.ts
150- @@ -0,0 +1,112 @@
150+ @@ -0,0 +1,116 @@
151151+ import * as vscode from "vscode";
152152+ import * as fs from "fs";
153153+ import * as path from "path";
@@ -180,6 +180,9 @@ Index: sagemaker-code-editor/vscode/extensions/sagemaker-idle-extension/src/exte
180180+ return;
181181+ }
182182+ idleFilePath = path.join(homeDirectory, ".sagemaker-last-active-timestamp");
183+ +
184+ + // Set initial lastActivetimestamp
185+ + updateLastActivityTimestamp()
183186+ }
184187+
185188+ /**
@@ -242,7 +245,7 @@ Index: sagemaker-code-editor/vscode/extensions/sagemaker-idle-extension/src/exte
242245+ const mtime = new Date(stats.mtime).getTime();
243246+ return now - mtime < CHECK_INTERVAL;
244247+ } catch (error) {
245- + console.error(`${LOG_PREFIX}} Error reading file stats:`, error);
248+ + console.error(`${LOG_PREFIX} Error reading file stats:`, error);
246249+ return false;
247250+ }
248251+ });
@@ -254,7 +257,8 @@ Index: sagemaker-code-editor/vscode/extensions/sagemaker-idle-extension/src/exte
254257+ };
255258+
256259+ /**
257- + * Updates the last activity timestamp by writing the current timestamp to the idle file.
260+ + * Updates the last activity timestamp by recording the current timestamp in the idle file and
261+ + * refreshing the status bar. The timestamp should be in ISO 8601 format and set to the UTC timezone.
258262+ */
259263+ function updateLastActivityTimestamp() {
260264+ const timestamp = new Date().toISOString();
0 commit comments