make fn clearable
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user