Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2024-12-19 23:59:22 +01:00
parent d8d393b180
commit 161c259dee
2 changed files with 10 additions and 9 deletions

View file

@ -104,7 +104,7 @@ impl XmppClient {
)
.await
}
debug!("XMPP Bot Processed Hook");
debug!("XMPP Bot Processed Hook");
}
}
}

View file

@ -28,11 +28,11 @@ use crate::error::Error;
use crate::hooks::Hook;
use crate::web::hooks;
use log::error;
use camino::Utf8PathBuf;
use clap::{command, value_parser, Arg};
use hyper::{server::conn::http1, service::service_fn};
use hyper_util::rt::tokio::{TokioIo, TokioTimer};
use log::error;
use tokio::{net::TcpListener, sync::mpsc};
#[tokio::main]
@ -76,13 +76,14 @@ async fn main() -> Result<!, Error> {
tokio::task::spawn(async move {
if let Err(err) = http1::Builder::new()
.timer(TokioTimer::new())
.serve_connection(io, service_fn(|request| {
let value_tx = value_tx.clone();
let secret = secret.clone();
async move {
hooks(request, &secret, value_tx).await
}
}))
.serve_connection(
io,
service_fn(|request| {
let value_tx = value_tx.clone();
let secret = secret.clone();
async move { hooks(request, &secret, value_tx).await }
}),
)
.await
{
println!("Error serving connection: {:?}", err);