diff --git a/lean/components/util/live_utils.py b/lean/components/util/live_utils.py index 5f79006b..7173301d 100644 --- a/lean/components/util/live_utils.py +++ b/lean/components/util/live_utils.py @@ -29,9 +29,8 @@ def _get_last_portfolio(api_client: APIClient, project_id: str, project_name: Pa cloud_last_time = utc.localize(datetime.min) if project_id: cloud_deployment = api_client.get("live/read", {"projectId": project_id}) - container.logger.info(f'----- After cloud_deployment_list: {cloud_deployment}') - if cloud_deployment["success"]: - cloud_last_time = datetime.strptime(cloud_deployment["launched"], "%Y-%m-%d %H:%M:%S").astimezone(UTC) + if cloud_deployment["success"] and cloud_deployment["status"] != "Undefined": + cloud_last_time = datetime.strptime(cloud_deployment["stopped"], "%Y-%m-%d %H:%M:%S").astimezone(UTC) local_last_time = utc.localize(datetime.min) live_deployment_path = f"{project_name}/live"