add configuration for the stdout pixel-changed interval

This commit is contained in:
Noa Aarts 2024-12-10 22:38:14 +01:00
parent 8969a9e6d5
commit 62d6dd76d3
Signed by: noa
GPG key ID: 1850932741EFF672
2 changed files with 5 additions and 2 deletions

View file

@ -9,7 +9,9 @@ use std::{
use chrono::Local;
use flurry::{
config::{GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL},
config::{
GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL, STDOUT_STATISTICS_INTERVAL,
},
flutclient::{FlutClient, ParserTypes},
grid::{self, Flut},
webapi::WebApiContext,
@ -21,7 +23,7 @@ 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<Never> {
let mut interval = tokio::time::interval(Duration::from_millis(1000));
let mut interval = tokio::time::interval(STDOUT_STATISTICS_INTERVAL);
loop {
interval.tick().await;
let cnt = COUNTER.load(std::sync::atomic::Ordering::Relaxed);