Skip to content

Commit

Permalink
PUT /netlist: don't reload netlist right away
Browse files Browse the repository at this point in the history
This was causing some timing issues, leading to a lot of 502 errors
when updating nets.
  • Loading branch information
nilclass committed Feb 11, 2024
1 parent 9ba8e4f commit 87ae245
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,14 @@ async fn get_nets(shared: web::Data<Shared>) -> Result<impl Responder> {

#[put("/nets")]
async fn put_nets(shared: web::Data<Shared>, json: web::Json<Vec<Net>>) -> Result<impl Responder> {
let netlist = shared
shared
.device_manager
.lock()
.unwrap()
.with_device(|device| {
device.set_netlist(validate::netlist(json.into_inner())?)?;
device.netlist()
})
.with_device(|device| device.set_netlist(validate::netlist(json.into_inner())?))
.map_err(Error)?;

Ok(web::Json(netlist))
Ok(web::Json(true))
}

#[get("/nets/{index}")]
Expand Down

0 comments on commit 87ae245

Please sign in to comment.