Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jetbrains-plugin] Update Workspace Timeout Logic #16107

Closed
Siddhant-K-code opened this issue Jan 30, 2023 · 0 comments · Fixed by #16267
Closed

[jetbrains-plugin] Update Workspace Timeout Logic #16107

Siddhant-K-code opened this issue Jan 30, 2023 · 0 comments · Fixed by #16267

Comments

@Siddhant-K-code
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants