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