Skip to content

Commit

Permalink
Avoid Noop
Browse files Browse the repository at this point in the history
  • Loading branch information
afsalthaj committed Jul 2, 2024
1 parent 95d8efc commit e354527
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl DefaultComponentElementsFetch {
let worker_id = worker_id.clone();
Box::pin(async move {
component_metadata_service
.get_active_component_in_worker(&worker_id)
.get_worker_component_version(&worker_id)
.await
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub trait ComponentMetadataService {
version: ComponentVersion,
) -> Result<ComponentDetails, MetadataFetchError>;

async fn get_active_component_in_worker(
async fn get_worker_component_version(
&self,
worker_id: &WorkerId,
) -> Result<ComponentVersion, MetadataFetchError>;
Expand All @@ -43,29 +43,3 @@ impl Display for MetadataFetchError {
}
}

pub struct NoopComponentMetadataService;

#[async_trait]
impl ComponentMetadataService for NoopComponentMetadataService {
async fn get_latest_component_metadata(
&self,
_component_id: &ComponentId,
) -> Result<ComponentDetails, MetadataFetchError> {
Err(MetadataFetchError::Internal("Not implemented".to_string()))
}

async fn get_component_metadata(
&self,
_component_id: &ComponentId,
_version: ComponentVersion,
) -> Result<ComponentDetails, MetadataFetchError> {
Err(MetadataFetchError::Internal("Not implemented".to_string()))
}

async fn get_active_component_in_worker(
&self,
_worker_id: &WorkerId,
) -> Result<ComponentVersion, MetadataFetchError> {
Err(MetadataFetchError::Internal("Not implemented".to_string()))
}
}
2 changes: 1 addition & 1 deletion golem-worker-service-base/src/http/http_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ mod tests {
self.get_latest_component_metadata(component_id).await
}

async fn get_active_component_in_worker(
async fn get_worker_component_version(
&self,
_worker_id: &WorkerId,
) -> Result<ComponentVersion, MetadataFetchError> {
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-service/src/component_metadata_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl ComponentMetadataService for DefaultComponentMetadataFetch {
.map_err(|e| MetadataFetchError::Internal(e.to_string()))
}

async fn get_active_component_in_worker(
async fn get_worker_component_version(
&self,
worker_id: &WorkerId,
) -> Result<ComponentVersion, MetadataFetchError> {
Expand Down

0 comments on commit e354527

Please sign in to comment.