feat: Add recovery scan for pending recordings

This commit introduces a new module `transcribe::recovery` and a
function `scan_and_enqueue`.
This function is called at startup to find audio files that have not yet
been transcribed
and re-enqueues them for processing. This ensures that recordings are
not lost if the
server restarts before transcription is complete.

A new integration test `recovery_enqueues_only_pending_recordings` has
been added to
verify the functionality.
This commit is contained in:
2026-04-13 16:47:38 +02:00
parent bcae4e5466
commit 13375b8297
4 changed files with 122 additions and 0 deletions
+9
View File
@@ -50,6 +50,15 @@ async fn main() {
http_client,
));
// Re-enqueue pending recordings left over from a previous run.
{
let tx = transcribe_tx.clone();
let data_path = config.data_path.clone();
tokio::spawn(async move {
transcribe::recovery::scan_and_enqueue(&data_path, &tx).await;
});
}
let state = AppState {
config: config.clone(),
transcribe_tx,