@@ -190,8 +190,8 @@ import { OrganizationService } from "../orgs/organization-service";
190
190
import { RedisSubscriber } from "../messaging/redis-subscriber" ;
191
191
import { UsageService } from "../orgs/usage-service" ;
192
192
import { UserService } from "../user/user-service" ;
193
- import { WorkspaceService } from "./workspace-service" ;
194
193
import { SSHKeyService } from "../user/sshkey-service" ;
194
+ import { StartWorkspaceOptions , WorkspaceService } from "./workspace-service" ;
195
195
196
196
// shortcut
197
197
export const traceWI = ( ctx : TraceContext , wi : Omit < LogContext , "userId" > ) => TraceContext . setOWI ( ctx , wi ) ; // userId is already taken care of in WebsocketConnectionManager
@@ -935,13 +935,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
935
935
// no matter if the workspace is shared or not, you cannot create a new instance
936
936
await this . guardAccess ( { kind : "workspaceInstance" , subject : undefined , workspace } , "create" ) ;
937
937
938
- options . region = await this . workspaceService . determineWorkspaceRegion (
939
- user . id ,
940
- workspaceId ,
941
- options . region || "" ,
942
- this . clientHeaderFields . clientRegion ,
943
- ) ;
944
- const result = await this . workspaceService . startWorkspace ( ctx , user , workspaceId , options ) ;
938
+ const opts : StartWorkspaceOptions = {
939
+ ...options ,
940
+ clientRegionCode : this . clientHeaderFields ?. clientRegion ,
941
+ } ;
942
+ const result = await this . workspaceService . startWorkspace ( ctx , user , workspaceId , opts ) ;
945
943
traceWI ( ctx , { instanceId : result . instanceID } ) ;
946
944
return result ;
947
945
}
@@ -1417,13 +1415,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1417
1415
logContext . workspaceId = workspace . id ;
1418
1416
traceWI ( ctx , { workspaceId : workspace . id } ) ;
1419
1417
1420
- options . region = await this . workspaceService . determineWorkspaceRegion (
1421
- user . id ,
1422
- workspace . id ,
1423
- options . region || "" ,
1424
- this . clientHeaderFields . clientRegion ,
1425
- ) ;
1426
- const startWorkspaceResult = await this . workspaceService . startWorkspace ( ctx , user , workspace . id , options ) ;
1418
+ const opts : StartWorkspaceOptions = {
1419
+ ...options ,
1420
+ clientRegionCode : this . clientHeaderFields ?. clientRegion ,
1421
+ } ;
1422
+ const startWorkspaceResult = await this . workspaceService . startWorkspace ( ctx , user , workspace . id , opts ) ;
1427
1423
ctx . span ?. log ( { event : "startWorkspaceComplete" , ...startWorkspaceResult } ) ;
1428
1424
1429
1425
return {
0 commit comments