From beb02b6f0e6e9d8066d59248285a1e6d8c6117b1 Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Wed, 20 Apr 2022 11:00:15 +0000 Subject: [PATCH] Use client with the correct region 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. --- components/server/ee/src/workspace/gitpod-server-impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/server/ee/src/workspace/gitpod-server-impl.ts b/components/server/ee/src/workspace/gitpod-server-impl.ts index 6d46644431073b..0bddcf83b3127b 100644 --- a/components/server/ee/src/workspace/gitpod-server-impl.ts +++ b/components/server/ee/src/workspace/gitpod-server-impl.ts @@ -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); }), );