Skip to content

Commit

Permalink
If none of the http codes are 200, dont send it to aspen
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Apr 24, 2024
1 parent 7892327 commit e5eff5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
8 changes: 7 additions & 1 deletion src/alpenrose/single_fetch_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
19 changes: 0 additions & 19 deletions src/aspen/import_alpenrose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, AspenisedVehiclePosition> = HashMap::new();
Expand Down

0 comments on commit e5eff5e

Please sign in to comment.