diff --git a/ami/ml/models/processing_service.py b/ami/ml/models/processing_service.py index d777c78f..991a7674 100644 --- a/ami/ml/models/processing_service.py +++ b/ami/ml/models/processing_service.py @@ -38,6 +38,9 @@ class Meta: def create_pipelines(self): # Call the status endpoint and get the pipelines/algorithms resp = self.get_status() + if resp.error: + resp.raise_for_status() + pipelines_to_add = resp.pipeline_configs pipelines = [] pipelines_created = [] @@ -99,16 +102,7 @@ def get_status(self): first_response_time = time.time() latency = first_response_time - start_time - return ProcessingServiceStatusResponse( - timestamp=timestamp, - request_successful=False, - server_live=False, - pipelines_online=[], - pipeline_configs=[], - endpoint_url=self.endpoint_url, - error=error, - latency=latency, - ) + return ProcessingServiceStatusResponse(error=error) pipeline_configs = resp.json() server_live = requests.get(urljoin(self.endpoint_url, "livez")).json().get("status") diff --git a/ui/src/pages/overview/processing-services/processing-services-actions.tsx b/ui/src/pages/overview/processing-services/processing-services-actions.tsx index a818c388..07ae3615 100644 --- a/ui/src/pages/overview/processing-services/processing-services-actions.tsx +++ b/ui/src/pages/overview/processing-services/processing-services-actions.tsx @@ -1,7 +1,8 @@ import { usePopulateProcessingService } from 'data-services/hooks/processing-services/usePopulateProcessingService' import { ProcessingService } from 'data-services/models/processing-service' import { Button, ButtonTheme } from 'design-system/components/button/button' -import { useState } from 'react' +import { IconType } from 'design-system/components/icon/icon' +import { Tooltip } from 'design-system/components/tooltip/tooltip' import { STRING, translate } from 'utils/language' export const PopulateProcessingService = ({ @@ -9,24 +10,25 @@ export const PopulateProcessingService = ({ }: { processingService: ProcessingService }) => { - const [timestamp, setTimestamp] = useState() - const { populateProcessingService: populateProcessingService, isLoading } = + const { populateProcessingService, isLoading, error } = usePopulateProcessingService() - // TODO: It would be better to inspect task status here, but we currently don't have this information. - const isPopulating = - isLoading || timestamp === processingService.updatedAtDetailed - return ( -