diff --git a/src/config.rs b/src/config.rs index 230f9f6..3318dea 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,7 +6,6 @@ pub const WEB_HOST: &str = "127.0.0.1:3000"; pub const IMAGE_SAVE_INTERVAL: Duration = Duration::from_secs(5); pub const JPEG_UPDATE_INTERVAL: Duration = Duration::from_millis(17); pub const WEB_UPDATE_INTERVAL: Duration = Duration::from_millis(50); -pub const STDOUT_STATISTICS_INTERVAL: Duration = Duration::from_millis(5000); pub const HELP_TEXT: &[u8] = b"Flurry is a pixelflut implementation, this means you can use commands to get and set pixels in the canvas SIZE returns the size of the canvas diff --git a/src/main.rs b/src/main.rs index 467a7fd..85fdfb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,28 +8,16 @@ use std::{ }; use flurry::{ - config::{ - GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL, STDOUT_STATISTICS_INTERVAL, - }, + config::{GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL}, flutclient::{FlutClient, ParserTypes}, grid::{self, Flut}, webapi::WebApiContext, - AsyncResult, COUNTER, + AsyncResult, }; use futures::never::Never; use tokio::{net::TcpListener, time::interval, try_join}; use tracing_subscriber::{layer::SubscriberExt as _, util::SubscriberInitExt as _}; -/// This function logs the current amount of changed pixels to stdout every second -async fn pixel_change_stdout_log() -> AsyncResult { - let mut interval = tokio::time::interval(STDOUT_STATISTICS_INTERVAL); - loop { - interval.tick().await; - let cnt = COUNTER.load(std::sync::atomic::Ordering::Relaxed); - tracing::info!("{cnt} pixels changed"); - } -} - /// This function starts a timer that saves the current grid state every `duration`. /// These images may then be used for moderation or timelapses /// @@ -116,7 +104,6 @@ async fn main() { }; tracing::info!("Started TCP listener on {HOST}"); - let pixel_logger = tokio::spawn(pixel_change_stdout_log()); let snapshots = tokio::spawn(save_image_frames(grids.clone(), IMAGE_SAVE_INTERVAL)); let pixelflut_server = tokio::spawn(handle_flut(flut_listener, grids.clone())); let jpeg_update_loop = tokio::spawn(jpeg_update_loop(grids.clone())); @@ -125,7 +112,6 @@ async fn main() { })); let res = try_join! { - pixel_logger, snapshots, pixelflut_server, jpeg_update_loop,