[fix](trx-rs): add NOAA-15/18/19 TLEs and move sat pass refresh off main connection
CelesTrak GROUP=weather does not include legacy NOAA POES satellites. Added GROUP=noaa fetch so NOAA-15/18/19 appear in predictions. Moved GetSatPasses to a dedicated TCP connection (client) and spawn_blocking (server) so pass computation never blocks state polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -271,6 +271,7 @@ async fn handle_client(
|
||||
}
|
||||
|
||||
// GetSatPasses: compute satellite passes from the server-side TLE store.
|
||||
// Runs on a blocking thread to avoid stalling the connection handler.
|
||||
if matches!(envelope.cmd, ClientCommand::GetSatPasses) {
|
||||
let result = if let Some((lat, lon)) = station_coords {
|
||||
let now_ms = std::time::SystemTime::now()
|
||||
@@ -278,7 +279,15 @@ async fn handle_client(
|
||||
.unwrap_or_default()
|
||||
.as_millis() as i64;
|
||||
let window_ms = 24 * 3600 * 1000; // 24 hours
|
||||
trx_core::geo::compute_upcoming_passes(lat, lon, now_ms, window_ms)
|
||||
tokio::task::spawn_blocking(move || {
|
||||
trx_core::geo::compute_upcoming_passes(lat, lon, now_ms, window_ms)
|
||||
})
|
||||
.await
|
||||
.unwrap_or_else(|_| trx_core::geo::PassPredictionResult {
|
||||
passes: vec![],
|
||||
satellite_count: 0,
|
||||
tle_source: trx_core::geo::TleSource::Unavailable,
|
||||
})
|
||||
} else {
|
||||
trx_core::geo::PassPredictionResult {
|
||||
passes: vec![],
|
||||
|
||||
Reference in New Issue
Block a user