Skip to content

Commit

Permalink
feat: warn adming when no service is enabled in the configration
Browse files Browse the repository at this point in the history
That migth be a config error.
  • Loading branch information
josecelano committed Jul 1, 2024
1 parent de8ed61 commit e299792
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ use crate::{core, servers};
/// - Can't retrieve tracker keys from database.
/// - Can't load whitelist from database.
pub async fn start(config: &Configuration, tracker: Arc<core::Tracker>) -> Vec<JoinHandle<()>> {
if config.http_api.is_none()
&& (config.udp_trackers.is_none() || config.udp_trackers.as_ref().map_or(true, std::vec::Vec::is_empty))
&& (config.http_trackers.is_none() || config.http_trackers.as_ref().map_or(true, std::vec::Vec::is_empty))
{
warn!("No services enabled in configuration");
}

let mut jobs: Vec<JoinHandle<()>> = Vec::new();

let registar = Registar::default();
Expand Down

0 comments on commit e299792

Please sign in to comment.