make fn clearable
Some checks failed
CI/CD Pipeline / deploy (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2025-07-21 21:30:59 +02:00
parent 1a5271c796
commit c31ad4290e
3 changed files with 15 additions and 2 deletions

View File

@@ -2,7 +2,9 @@ use crate::state::AppState;
use std::sync::Arc;
use tokio_stream::StreamExt;
pub fn spawn_download_task(url: &str, state: Arc<AppState>) {
pub async fn spawn_download_task(url: &str, state: Arc<AppState>) {
state.reset().await;
let url = url.to_string();
tokio::spawn(async move {
if let Err(e) = download_stream(&url, state).await {