From 39e59dca96f5c40d531d4a6b8b8f74750f42c0b1 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 1 Aug 2026 01:55:33 +0200 Subject: [PATCH] [fix](trx-server): gate test-only history imports --- src/trx-server/src/audio.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/trx-server/src/audio.rs b/src/trx-server/src/audio.rs index 6f191fe7..a0b90a87 100644 --- a/src/trx-server/src/audio.rs +++ b/src/trx-server/src/audio.rs @@ -6,7 +6,9 @@ #[cfg(feature = "ft2")] use std::collections::HashMap; -use std::collections::{HashSet, VecDeque}; +use std::collections::HashSet; +#[cfg(test)] +use std::collections::VecDeque; use std::net::SocketAddr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; @@ -33,10 +35,9 @@ use trx_core::audio::{ AUDIO_MSG_VCHAN_MODE, AUDIO_MSG_VCHAN_REMOVE, AUDIO_MSG_VCHAN_SUB, AUDIO_MSG_VCHAN_UNSUB, AUDIO_MSG_VDES_DECODE, AUDIO_MSG_WEFAX_DECODE, AUDIO_MSG_WEFAX_PROGRESS, AUDIO_MSG_WSPR_DECODE, }; -use trx_core::decode::{ - AisMessage, AprsPacket, CwEvent, DecodedMessage, Ft8Message, LrptImage, LrptProgress, - WsprMessage, -}; +#[cfg(test)] +use trx_core::decode::{AisMessage, AprsPacket, CwEvent}; +use trx_core::decode::{DecodedMessage, Ft8Message, LrptImage, LrptProgress, WsprMessage}; use trx_core::rig::state::{RigMode, RigState}; use trx_core::vchan::SharedVChanManager; use trx_cw::CwDecoder; @@ -46,9 +47,9 @@ use trx_wspr::WsprDecoder; use uuid::Uuid; use crate::config::AudioConfig; -use crate::history_policy::{ - current_timestamp_ms, enforce_capacity, lock_or_recover, prune_by_age, MAX_HISTORY_ENTRIES, -}; +use crate::history_policy::{current_timestamp_ms, lock_or_recover}; +#[cfg(test)] +use crate::history_policy::{enforce_capacity, prune_by_age, MAX_HISTORY_ENTRIES}; use trx_decode_log::DecoderLoggers; /// Silence timeout before auto-finalising an LRPT pass (30 s without new MCUs).