Move server code into its own module

This commit is contained in:
Joscha 2023-08-07 14:23:47 +02:00
parent ad0c1a69cb
commit 45abda2b6d
12 changed files with 15 additions and 4 deletions

View file

@ -1,10 +1,9 @@
mod args; mod args;
mod config; mod config;
mod recurring; mod server;
mod somehow; mod somehow;
mod state; mod state;
mod util; mod util;
mod web;
use std::{io, path::PathBuf, process}; use std::{io, path::PathBuf, process};
@ -105,8 +104,7 @@ async fn run() -> somehow::Result<()> {
info!("Startup complete, running"); info!("Startup complete, running");
select! { select! {
_ = wait_for_signal() => {} _ = wait_for_signal() => {}
_ = web::run(state.clone()) => {} _ = server::run(state.clone()) => {}
_ = recurring::run(state.clone()) => {}
} }
select! { select! {

13
src/server.rs Normal file
View file

@ -0,0 +1,13 @@
mod recurring;
mod web;
use tokio::select;
use crate::{somehow, state::AppState};
pub async fn run(state: AppState) -> somehow::Result<()> {
select! {
e = web::run(state.clone()) => e,
() = recurring::run(state.clone()) => Ok(()),
}
}