make repository updates non-blocking
This commit is contained in:
parent
8cd9f0030d
commit
ef424cf070
2 changed files with 6 additions and 3 deletions
|
@ -44,7 +44,11 @@ async fn update(payload: web::Json<DeployEvent>) -> impl Responder {
|
||||||
let mut found = false;
|
let mut found = false;
|
||||||
for page in SETTINGS.pages.iter() {
|
for page in SETTINGS.pages.iter() {
|
||||||
if page.secret == payload.secret {
|
if page.secret == payload.secret {
|
||||||
page.fetch_upstream(&page.branch);
|
web::block(|| {
|
||||||
|
page.fetch_upstream(&page.branch);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,9 +71,8 @@ async fn main() -> std::io::Result<()> {
|
||||||
actix_middleware::TrailingSlash::Trim,
|
actix_middleware::TrailingSlash::Trim,
|
||||||
))
|
))
|
||||||
.configure(services)
|
.configure(services)
|
||||||
// .app_data(data.clone())
|
|
||||||
})
|
})
|
||||||
.workers(SETTINGS.server.workers.unwrap_or(num_cpus::get()))
|
.workers(SETTINGS.server.workers.unwrap_or_else(num_cpus::get))
|
||||||
.bind(SETTINGS.server.get_ip())
|
.bind(SETTINGS.server.get_ip())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.run()
|
.run()
|
||||||
|
|
Loading…
Reference in a new issue