mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
fix main events
This commit is contained in:
parent
f5e10f5a8f
commit
37beaea48b
1 changed files with 6 additions and 6 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -216,7 +216,7 @@ async fn run_server() -> Result<(), error::Serve> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for listen in &config.listen {
|
for listen in &config.listen {
|
||||||
info!("Listening for incoming traffic on {listen}");
|
info!(listener = %listen, "Listening for incoming traffic");
|
||||||
match listen {
|
match listen {
|
||||||
ListenConfig::Tcp {
|
ListenConfig::Tcp {
|
||||||
address,
|
address,
|
||||||
|
|
@ -283,7 +283,7 @@ async fn unrecognized_method(
|
||||||
let uri = req.uri().clone();
|
let uri = req.uri().clone();
|
||||||
let inner = next.run(req).await;
|
let inner = next.run(req).await;
|
||||||
if inner.status() == StatusCode::METHOD_NOT_ALLOWED {
|
if inner.status() == StatusCode::METHOD_NOT_ALLOWED {
|
||||||
warn!("Method not allowed: {method} {uri}");
|
warn!(%method, %uri, "Method not allowed");
|
||||||
return Ok(Ra(UiaaResponse::MatrixError(RumaError {
|
return Ok(Ra(UiaaResponse::MatrixError(RumaError {
|
||||||
body: ErrorBody::Standard {
|
body: ErrorBody::Standard {
|
||||||
kind: ErrorKind::Unrecognized,
|
kind: ErrorKind::Unrecognized,
|
||||||
|
|
@ -519,7 +519,7 @@ async fn shutdown_signal(handles: Vec<ServerHandle>) {
|
||||||
() = terminate => { sig = "SIGTERM"; },
|
() = terminate => { sig = "SIGTERM"; },
|
||||||
}
|
}
|
||||||
|
|
||||||
warn!(signal = %sig, "shutting down due to signal");
|
warn!(signal = %sig, "Shutting down due to signal");
|
||||||
|
|
||||||
services().globals.shutdown();
|
services().globals.shutdown();
|
||||||
|
|
||||||
|
|
@ -537,7 +537,7 @@ async fn federation_disabled(_: Uri) -> impl IntoResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn not_found(method: Method, uri: Uri) -> impl IntoResponse {
|
async fn not_found(method: Method, uri: Uri) -> impl IntoResponse {
|
||||||
debug!(%method, %uri, "unknown route");
|
debug!(%method, %uri, "Unknown route");
|
||||||
Error::BadRequest(ErrorKind::Unrecognized, "Unrecognized request")
|
Error::BadRequest(ErrorKind::Unrecognized, "Unrecognized request")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -657,11 +657,11 @@ fn maximize_fd_limit() -> Result<(), nix::errno::Errno> {
|
||||||
|
|
||||||
let (soft_limit, hard_limit) = getrlimit(res)?;
|
let (soft_limit, hard_limit) = getrlimit(res)?;
|
||||||
|
|
||||||
debug!("Current nofile soft limit: {soft_limit}");
|
debug!(soft_limit, "Current nofile soft limit");
|
||||||
|
|
||||||
setrlimit(res, hard_limit, hard_limit)?;
|
setrlimit(res, hard_limit, hard_limit)?;
|
||||||
|
|
||||||
debug!("Increased nofile soft limit to {hard_limit}");
|
debug!(hard_limit, "Increased nofile soft limit to the hard limit");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue