[fix](trx-server): fix NOAA decoder warnings and Send bound
- Remove unused chrono::Local import (use fully-qualified path) - Drop watch::Ref before .await in state-change branch to satisfy Send - Remove unused pass_start_ms parameter from finalize_noaa_pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -11,7 +11,6 @@ use std::sync::{Arc, Mutex};
|
|||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use chrono::Local;
|
|
||||||
use flate2::write::GzEncoder;
|
use flate2::write::GzEncoder;
|
||||||
use flate2::Compression;
|
use flate2::Compression;
|
||||||
use num_complex::Complex;
|
use num_complex::Complex;
|
||||||
@@ -2477,11 +2476,15 @@ pub async fn run_noaa_decoder(
|
|||||||
changed = state_rx.changed() => {
|
changed = state_rx.changed() => {
|
||||||
match changed {
|
match changed {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
|
// Extract fields before any await so the Ref is dropped.
|
||||||
|
let (new_active, new_reset_seq) = {
|
||||||
let state = state_rx.borrow();
|
let state = state_rx.borrow();
|
||||||
|
(state.noaa_decode_enabled, state.noaa_decode_reset_seq)
|
||||||
|
};
|
||||||
let was_active = active;
|
let was_active = active;
|
||||||
active = state.noaa_decode_enabled;
|
active = new_active;
|
||||||
if state.noaa_decode_reset_seq != last_reset_seq {
|
if new_reset_seq != last_reset_seq {
|
||||||
last_reset_seq = state.noaa_decode_reset_seq;
|
last_reset_seq = new_reset_seq;
|
||||||
decoder.reset();
|
decoder.reset();
|
||||||
pass_start_ms = current_timestamp_ms();
|
pass_start_ms = current_timestamp_ms();
|
||||||
}
|
}
|
||||||
@@ -2489,7 +2492,6 @@ pub async fn run_noaa_decoder(
|
|||||||
// User disabled — finalise whatever we have
|
// User disabled — finalise whatever we have
|
||||||
finalize_noaa_pass(
|
finalize_noaa_pass(
|
||||||
&mut decoder,
|
&mut decoder,
|
||||||
pass_start_ms,
|
|
||||||
&output_dir,
|
&output_dir,
|
||||||
&decode_tx,
|
&decode_tx,
|
||||||
&histories,
|
&histories,
|
||||||
@@ -2514,7 +2516,6 @@ pub async fn run_noaa_decoder(
|
|||||||
);
|
);
|
||||||
finalize_noaa_pass(
|
finalize_noaa_pass(
|
||||||
&mut decoder,
|
&mut decoder,
|
||||||
pass_start_ms,
|
|
||||||
&output_dir,
|
&output_dir,
|
||||||
&decode_tx,
|
&decode_tx,
|
||||||
&histories,
|
&histories,
|
||||||
@@ -2532,7 +2533,6 @@ pub async fn run_noaa_decoder(
|
|||||||
/// `DecodedMessage::NoaaImage` event. No-ops if fewer than 2 lines decoded.
|
/// `DecodedMessage::NoaaImage` event. No-ops if fewer than 2 lines decoded.
|
||||||
async fn finalize_noaa_pass(
|
async fn finalize_noaa_pass(
|
||||||
decoder: &mut AptDecoder,
|
decoder: &mut AptDecoder,
|
||||||
pass_start_ms: i64,
|
|
||||||
output_dir: &std::path::Path,
|
output_dir: &std::path::Path,
|
||||||
decode_tx: &broadcast::Sender<DecodedMessage>,
|
decode_tx: &broadcast::Sender<DecodedMessage>,
|
||||||
histories: &Arc<DecoderHistories>,
|
histories: &Arc<DecoderHistories>,
|
||||||
|
|||||||
Reference in New Issue
Block a user