INNER CODE UNIT · Rust

Ok

HemantKArya/BloomeeTunes · rust/src/api/downloader/mod.rs:277

        if let Ok(g) = task.lock() {
            g.pause_requested.store(true, Ordering::Release);
        }
        true
    }

    /// Queue a paused/failed task for another download attempt.
    pub async fn resume_task(&self, task_id: String) -> bool {
        let Some(task) = self.get_task(&task_id) else { return false };

        let should_spawn = {
            let mut g = match task.lock() {
                Ok(g) => g,
                Err(_) => return false,
            };
            let resumable = matches!(
                g.persisted.state,
                DownloadTaskState::Paused | DownloadTaskState::Failed | DownloadTaskState::Queued

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…