mirror of
https://codeberg.org/icewind/ptouch-api.git
synced 2026-06-03 10:54:07 +02:00
cargo updates
This commit is contained in:
parent
0631be6414
commit
1b82593cf1
3 changed files with 336 additions and 591 deletions
31
src/main.rs
31
src/main.rs
|
|
@ -74,26 +74,23 @@ async fn main() -> MainResult {
|
|||
match (systemd_listener.take_unix_listener(0), &config.listen) {
|
||||
(Ok(Some(listener)), _) => {
|
||||
info!("listening on fd 0");
|
||||
let listener = UnixListener::from_std(listener).unwrap();
|
||||
let listener = UnixListener::from_std(listener)?;
|
||||
axum::serve(listener, app)
|
||||
.with_graceful_shutdown(cancel)
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
}
|
||||
(_, ListenConfig::Unix { socket: path }) => {
|
||||
if let Some(parent) = path.parent() {
|
||||
if !parent.exists() {
|
||||
create_dir_all(parent).map_err(|error| SetupError::CreateSocketParent {
|
||||
if let Some(parent) = path.parent() && !parent.exists() {
|
||||
create_dir_all(parent).map_err(|error| SetupError::CreateSocketParent {
|
||||
error,
|
||||
path: parent.into(),
|
||||
})?;
|
||||
set_permissions(parent, PermissionsExt::from_mode(0o666)).map_err(|error| {
|
||||
SetupError::SocketParentPermissions {
|
||||
error,
|
||||
path: parent.into(),
|
||||
})?;
|
||||
set_permissions(parent, PermissionsExt::from_mode(0o666)).map_err(|error| {
|
||||
SetupError::SocketParentPermissions {
|
||||
error,
|
||||
path: parent.into(),
|
||||
}
|
||||
})?;
|
||||
}
|
||||
}
|
||||
})?;
|
||||
}
|
||||
let _ = remove_file(path);
|
||||
|
||||
|
|
@ -107,8 +104,7 @@ async fn main() -> MainResult {
|
|||
|
||||
axum::serve(uds, app)
|
||||
.with_graceful_shutdown(cancel)
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
}
|
||||
(_, ListenConfig::Tcp { address, port }) => {
|
||||
let address = SocketAddr::new(*address, *port);
|
||||
|
|
@ -118,8 +114,7 @@ async fn main() -> MainResult {
|
|||
info!("listening on {}", address);
|
||||
axum::serve(listener, app)
|
||||
.with_graceful_shutdown(cancel)
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue