aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-27 14:58:28 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-27 14:58:28 +0100
commit7ac24ad913fa081e1bd6f5b042b9da0173dad267 (patch)
treee8cb9d877ea0df530f6699d7d96dced66ff079d6 /src/server.rs
parent54c9736a247bb3534a285caa637c9afb052bc2dd (diff)
downloadaerogramme-7ac24ad913fa081e1bd6f5b042b9da0173dad267.tar.gz
aerogramme-7ac24ad913fa081e1bd6f5b042b9da0173dad267.zip
cargo format
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/server.rs b/src/server.rs
index 552a0e6..28e0b27 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -1,6 +1,6 @@
-use std::sync::Arc;
-use std::path::PathBuf;
use std::io::Write;
+use std::path::PathBuf;
+use std::sync::Arc;
use anyhow::Result;
use futures::try_join;
@@ -26,7 +26,11 @@ impl Server {
let lmtp_server = None;
let imap_server = Some(imap::new(config.imap, login.clone()).await?);
- Ok(Self { lmtp_server, imap_server, pid_file: config.pid })
+ Ok(Self {
+ lmtp_server,
+ imap_server,
+ pid_file: config.pid,
+ })
}
pub async fn from_provider_config(config: ProviderConfig) -> Result<Self> {
@@ -39,12 +43,16 @@ impl Server {
let lmtp_server = Some(LmtpServer::new(config.lmtp, login.clone()));
let imap_server = Some(imap::new(config.imap, login.clone()).await?);
- Ok(Self { lmtp_server, imap_server, pid_file: config.pid })
+ Ok(Self {
+ lmtp_server,
+ imap_server,
+ pid_file: config.pid,
+ })
}
pub async fn run(self) -> Result<()> {
let pid = std::process::id();
- tracing::info!(pid=pid, "Starting main loops");
+ tracing::info!(pid = pid, "Starting main loops");
// write the pid file
if let Some(pid_file) = self.pid_file {
@@ -57,7 +65,6 @@ impl Server {
drop(file);
}
-
let (exit_signal, provoke_exit) = watch_ctrl_c();
let _exit_on_err = move |err: anyhow::Error| {
error!("Error: {}", err);