Increase block_id timeout from 3s to 3600s for test scenarios

The 3-second timeout was causing streams to stop prematurely after
block download completed (~3 minutes) instead of playing for the
full block duration (~30 minutes).

For test scenarios with a single block, we need a much longer timeout
to allow the TimerNode to pace the stream properly over the full
block duration.

Changes:
- BLOCK_ID_TIMEOUT_SECS: 3 → 3600 seconds (1 hour)
- Modified download_and_decode_block() to return final timestamp
- EndOfStream now uses correct timestamp instead of 0.0

This allows the TimerNode to properly pace the stream in real-time
instead of the stream ending immediately after download completes.
This commit is contained in:
Claude
2025-11-12 06:27:24 +00:00
parent 684187b6ce
commit 49630f4e54

View File

@@ -25,8 +25,10 @@ use tokio::io::AsyncReadExt;
use tokio::sync::{mpsc, RwLock}; use tokio::sync::{mpsc, RwLock};
use tokio_util::{io::StreamReader, sync::CancellationToken}; use tokio_util::{io::StreamReader, sync::CancellationToken};
/// Timeout pour attendre un nouveau block ID (radio en temps réel) /// Timeout pour attendre un nouveau block ID
const BLOCK_ID_TIMEOUT_SECS: u64 = 3; /// Pour une radio en temps réel, 3s est raisonnable
/// Pour des tests avec un seul bloc, on veut quelque chose de plus long
const BLOCK_ID_TIMEOUT_SECS: u64 = 3600; // 1 heure
/// Nombre de blocs récents à mémoriser pour éviter les re-téléchargements /// Nombre de blocs récents à mémoriser pour éviter les re-téléchargements
const RECENT_BLOCKS_CACHE_SIZE: usize = 10; const RECENT_BLOCKS_CACHE_SIZE: usize = 10;