Skip to content

Commit

Permalink
attempt #2 at removing get worker by id
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburniske committed Feb 1, 2024
1 parent 2fb2897 commit fa11fb7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
4 changes: 0 additions & 4 deletions golem-api-grpc/proto/golem/worker/worker_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ message ResumeWorkerResponse {
}
}

message GetWorkerByIdRequest {
golem.worker.WorkerId workerId = 1;
}

message ConnectWorkerRequest {
golem.worker.WorkerId worker_id = 1;
}
Expand Down
16 changes: 1 addition & 15 deletions golem-service/src/grpcapi/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use golem_api_grpc::proto::golem::common::{Empty, ErrorBody, ErrorsBody};
use golem_api_grpc::proto::golem::worker::worker_service_server::WorkerService as GrpcWorkerService;
use golem_api_grpc::proto::golem::worker::{
complete_promise_response, delete_worker_response, get_invocation_key_response,
get_worker_by_id_response, get_worker_metadata_response, interrupt_worker_response,
get_worker_metadata_response, interrupt_worker_response,
invoke_and_await_response, invoke_and_await_response_json, invoke_response,
launch_new_worker_response, resume_worker_response, CompletePromiseRequest,
CompletePromiseResponse, ConnectWorkerRequest, DeleteWorkerRequest, DeleteWorkerResponse,
Expand Down Expand Up @@ -44,20 +44,6 @@ pub struct WorkerGrpcApi {

#[async_trait::async_trait]
impl GrpcWorkerService for WorkerGrpcApi {
async fn get_worker_by_id(
&self,
request: Request<GetWorkerByIdRequest>,
) -> Result<Response<GetWorkerByIdResponse>, Status> {
let response = match self.get_worker_by_id(request.into_inner()).await {
Ok(worker_id) => get_worker_by_id_response::Result::Success(worker_id),
Err(error) => get_worker_by_id_response::Result::Error(error),
};

Ok(Response::new(GetWorkerByIdResponse {
result: Some(response),
}))
}

async fn launch_new_worker(
&self,
request: Request<LaunchNewWorkerRequest>,
Expand Down

0 comments on commit fa11fb7

Please sign in to comment.