@@ -427,48 +427,50 @@ impl WorkerClient for WorkerExecutorWorkerClient {
427427 ) -> WorkerResult < ( AgentId , AgentFingerprint ) > {
428428 let agent_id_clone = agent_id. clone ( ) ;
429429 let account_id_clone = account_id;
430- let fingerprint = self . call_worker_executor (
431- agent_id. clone ( ) ,
432- "create_worker" ,
433- move |worker_executor_client| {
434- let agent_id = agent_id_clone. clone ( ) ;
435- Box :: pin (
436- worker_executor_client. create_worker ( CreateWorkerRequest {
437- agent_id : Some ( agent_id. into ( ) ) ,
438- env : environment_variables. clone ( ) ,
439- config : config
440- . clone ( )
441- . into_iter ( )
442- . map ( golem_api_grpc:: proto:: golem:: worker:: AgentConfigEntryDto :: from)
443- . collect ( ) ,
444- component_owner_account_id : Some ( account_id_clone. into ( ) ) ,
445- environment_id : Some ( environment_id. into ( ) ) ,
446- ignore_already_existing,
447- auth_ctx : Some ( auth_ctx. clone ( ) . into ( ) ) ,
448- principal : principal. clone ( ) ,
449- invocation_context : invocation_context. clone ( ) ,
450- } ) ,
451- )
452- } ,
453- |response| {
454- use workerexecutor:: v1:: create_worker_success_response:: Fingerprint ;
455- match response. into_inner ( ) {
430+ let fingerprint = self
431+ . call_worker_executor (
432+ agent_id. clone ( ) ,
433+ "create_worker" ,
434+ move |worker_executor_client| {
435+ let agent_id = agent_id_clone. clone ( ) ;
436+ Box :: pin (
437+ worker_executor_client. create_worker ( CreateWorkerRequest {
438+ agent_id : Some ( agent_id. into ( ) ) ,
439+ env : environment_variables. clone ( ) ,
440+ config : config
441+ . clone ( )
442+ . into_iter ( )
443+ . map (
444+ golem_api_grpc:: proto:: golem:: worker:: AgentConfigEntryDto :: from,
445+ )
446+ . collect ( ) ,
447+ component_owner_account_id : Some ( account_id_clone. into ( ) ) ,
448+ environment_id : Some ( environment_id. into ( ) ) ,
449+ ignore_already_existing,
450+ auth_ctx : Some ( auth_ctx. clone ( ) . into ( ) ) ,
451+ principal : principal. clone ( ) ,
452+ invocation_context : invocation_context. clone ( ) ,
453+ } ) ,
454+ )
455+ } ,
456+ |response| match response. into_inner ( ) {
456457 workerexecutor:: v1:: CreateWorkerResponse {
457- result : Some ( workerexecutor:: v1:: create_worker_response:: Result :: Success (
458- workerexecutor:: v1:: CreateWorkerSuccessResponse {
459- fingerprint : Some ( Fingerprint :: FingerprintUuid ( u) ) ,
460- } ,
461- ) ) ,
458+ result :
459+ Some ( workerexecutor:: v1:: create_worker_response:: Result :: Success (
460+ workerexecutor:: v1:: CreateWorkerSuccessResponse {
461+ instance_id : Some ( u) ,
462+ } ,
463+ ) ) ,
462464 } => Ok ( AgentFingerprint ( u. into ( ) ) ) ,
463465 workerexecutor:: v1:: CreateWorkerResponse {
464- result : Some ( workerexecutor:: v1:: create_worker_response:: Result :: Failure ( err) ) ,
466+ result :
467+ Some ( workerexecutor:: v1:: create_worker_response:: Result :: Failure ( err) ) ,
465468 } => Err ( err. into ( ) ) ,
466469 workerexecutor:: v1:: CreateWorkerResponse { .. } => Err ( "Empty response" . into ( ) ) ,
467- }
468- } ,
469- WorkerServiceError :: InternalCallError ,
470- )
471- . await ?;
470+ } ,
471+ WorkerServiceError :: InternalCallError ,
472+ )
473+ . await ?;
472474
473475 Ok ( ( agent_id. clone ( ) , fingerprint) )
474476 }
0 commit comments