From c41ee6383e5888aa6cf95b379e24482972d485f1 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 21 Apr 2025 11:54:39 +0700 Subject: [PATCH] QFIX: Show warning of not visited workspace only once (#8641) Signed-off-by: Andrey Sobolev --- services/github/pod-github/src/platform.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/github/pod-github/src/platform.ts b/services/github/pod-github/src/platform.ts index bddba3fb75..b38b15e5f5 100644 --- a/services/github/pod-github/src/platform.ts +++ b/services/github/pod-github/src/platform.ts @@ -798,6 +798,8 @@ export class PlatformWorker { return this.integrations.map((it) => it.workspace) } + checkedWorkspaces = new Set() + async checkWorkspaceIsActive ( token: string, workspace: WorkspaceUuid @@ -825,7 +827,10 @@ export class PlatformWorker { const lastVisit = (Date.now() - (workspaceInfo.lastVisit ?? 0)) / (3600 * 24 * 1000) // In days if (config.WorkspaceInactivityInterval > 0 && lastVisit > config.WorkspaceInactivityInterval) { - this.ctx.warn('Workspace is inactive for too long, skipping for now.', { workspace }) + if (!this.checkedWorkspaces.has(workspace)) { + this.checkedWorkspaces.add(workspace) + this.ctx.warn('Workspace is inactive for too long, skipping for now.', { workspace }) + } return { workspaceInfo: undefined, needRecheck: true } } return { workspaceInfo, needRecheck: true }