diff --git a/src/alpenrose/single_fetch_time.rs b/src/alpenrose/single_fetch_time.rs index 3f2c7617..521b540e 100644 --- a/src/alpenrose/single_fetch_time.rs +++ b/src/alpenrose/single_fetch_time.rs @@ -119,7 +119,8 @@ pub async fn single_fetch_time( ) .spawn(); - let tarpc_send_to_aspen = aspen_client + if (vehicle_positions_http_status == Some(200) || trip_updates_http_status == Some(200) || alerts_http_status == Some(200)) { + let tarpc_send_to_aspen = aspen_client .from_alpenrose( tarpc::context::current(), data.chateau_id, @@ -233,6 +234,11 @@ pub async fn single_fetch_time( eprintln!("{}: Error sending data to {}: {}", feed_id, worker_id, e); } } + } else { + println!("{}: No data to send", feed_id); + } + + } None => { eprintln!("{} was not assigned to a worker", feed_id); diff --git a/src/aspen/import_alpenrose.rs b/src/aspen/import_alpenrose.rs index 875a3703..19708c9a 100644 --- a/src/aspen/import_alpenrose.rs +++ b/src/aspen/import_alpenrose.rs @@ -123,25 +123,6 @@ pub async fn new_rt_data( let this_chateau_dashmap = authoritative_data_store.get(&realtime_feed_id); - //if this item is empty, create it - if this_chateau_dashmap.is_none() { - let new_aspenised_data = catenary::aspen_dataset::AspenisedData { - vehicle_positions: HashMap::new(), - vehicle_routes_cache: HashMap::new(), - trip_updates: HashMap::new(), - trip_updates_lookup_by_trip_id_to_trip_update_ids: HashMap::new(), - raw_alerts: None, - impacted_routes_alerts: None, - impacted_stops_alerts: None, - impacted_routes_stops_alerts: None, - last_updated_time_ms: 0, - }; - let _ = authoritative_data_store.insert(realtime_feed_id.clone(), new_aspenised_data); - } - - //now it exists! - let this_chateau_dashmap = authoritative_data_store.get(&realtime_feed_id).unwrap(); - // take all the gtfs rt data and merge it together let mut vehicle_positions: HashMap = HashMap::new();