use fathom_function::tracing; use pipeline_application::application::Application; use serde::{Deserialize, Serialize}; use uuid::Uuid; #[fathom_function::function] async fn facility_locations(input: Input) -> Result { let app = Application::new_from_compile_env(input.org_id, input.project_id).unwrap(); for pipeline_id in input.pipeline_id { app.update_assets_with_geo_locations(pipeline_id) .await .map_err(|err| { tracing::error!(%pipeline_id, ?err, "Error updating facility locations"); format!("{err:?}") })?; } Ok(Output { status: "Success".to_owned(), }) } #[derive(Debug, Serialize)] struct Output { status: String, } #[derive(Debug, Deserialize)] struct Input { org_id: Uuid, project_id: String, pipeline_id: Vec, }