added args for running binary
This commit is contained in:
@@ -2,13 +2,11 @@
|
||||
/// This agent collects hardware metrics and sends them to a backend server.
|
||||
/// It supports CPU, GPU, RAM, disk, and network metrics.
|
||||
pub mod api;
|
||||
pub mod config;
|
||||
pub mod hardware;
|
||||
pub mod metrics;
|
||||
pub mod models;
|
||||
|
||||
use crate::config::Settings;
|
||||
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::marker::Send;
|
||||
use std::marker::Sync;
|
||||
@@ -27,11 +25,9 @@ async fn flatten<T>(
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let settings = Settings::new().expect("Failed to load configuration");
|
||||
let args: Vec<String> = env::args().collect();
|
||||
|
||||
// Explicit variables for each .env / config field
|
||||
let _app_port = settings.app.port;
|
||||
let server_url = settings.server.url;
|
||||
let server_url = &args[1];
|
||||
|
||||
// Registration
|
||||
let (server_id, ip) = match api::register_with_server(&server_url).await {
|
||||
|
Reference in New Issue
Block a user