requested changes

This commit is contained in:
mpostma
2020-05-28 16:12:24 +02:00
parent 2a32ad39a0
commit 8a2e60dc09
10 changed files with 46 additions and 114 deletions

View File

@ -20,20 +20,12 @@ async fn get_health(data: web::Data<Data>) -> Result<HttpResponse, ResponseError
}
async fn set_healthy(data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
data.db.main_write::<_, _, ResponseError>(|writer| {
data.db.set_healthy(writer)?;
Ok(())
})?;
data.db.main_write(|w| data.db.set_healthy(w))?;
Ok(HttpResponse::Ok().finish())
}
async fn set_unhealthy(data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
data.db.main_write::<_, _, ResponseError>(|writer| {
data.db.set_unhealthy(writer)?;
Ok(())
})?;
data.db.main_write(|w| data.db.set_unhealthy(w))?;
Ok(HttpResponse::Ok().finish())
}