Skip to content

Commit

Permalink
Use client with the correct region
Browse files Browse the repository at this point in the history
Don't assume that the region of each workspace that needs its timeout
extended is in the same region as the workspace for which the extension was
requested.
  • Loading branch information
Andrew Farries authored and roboquat committed Apr 20, 2022
1 parent a60b913 commit beb02b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/server/ee/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,12 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
(i) => i.workspaceId !== workspaceId && i.status.timeout !== defaultTimeout && i.status.phase === "running",
);
await Promise.all(
instancesWithReset.map((i) => {
instancesWithReset.map(async (i) => {
const req = new SetTimeoutRequest();
req.setId(i.id);
req.setDuration(this.userService.workspaceTimeoutToDuration(defaultTimeout));

const client = await this.workspaceManagerClientProvider.get(i.region);
return client.setTimeout(ctx, req);
}),
);
Expand Down

0 comments on commit beb02b6

Please sign in to comment.