Skip to content

[jetbrains-plugin] Update Workspace Timeout Logic #16107

Closed
@Siddhant-K-code

Description

@Siddhant-K-code

Description

This conversation started here. Also see this Internal discussion that the following logic is does not anymore:

if (result.resetTimeoutOnWorkspaces.isNotEmpty()) {
message = "Workspace timeout has been extended to three hours. This reset the workspace timeout for other workspaces."
notificationType = NotificationType.WARNING
} else {
message = "Workspace timeout has been extended to three hours."
notificationType = NotificationType.INFORMATION
}

And, This reset the workspace timeout for other workspaces. is not true. & It is also weird that it returns the current workspace in reset list:

const workspace = await this.internalGetWorkspace(workspaceId, this.workspaceDb.trace(ctx));
const runningInstances = await this.workspaceDb.trace(ctx).findRegularRunningInstances(user.id);
const runningInstance = runningInstances.find((i) => i.workspaceId === workspaceId);
if (!runningInstance) {
throw new ResponseError(ErrorCodes.NOT_FOUND, "Can only set keep-alive for running workspaces");
}
await this.guardAccess({ kind: "workspaceInstance", subject: runningInstance, workspace: workspace }, "update");
const client = await this.workspaceManagerClientProvider.get(
runningInstance.region,
this.config.installationShortname,
);
const req = new SetTimeoutRequest();
req.setId(runningInstance.id);
req.setDuration(validatedDuration);
await client.setTimeout(ctx, req);
return {
resetTimeoutOnWorkspaces: [workspace.id],
};

Also, Related #16083

Action Item

Remove & Update this logic

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions