From c9ca5ee6e768a48c7bff965641b177ecbc48d829 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 25 Sep 2023 16:32:12 +1000 Subject: [PATCH] Fix cancel signal being ignored if sent quickly --- rslib/src/scheduler/fsrs/weights.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/scheduler/fsrs/weights.rs b/rslib/src/scheduler/fsrs/weights.rs index 60a7871a2..f68f3c6c7 100644 --- a/rslib/src/scheduler/fsrs/weights.rs +++ b/rslib/src/scheduler/fsrs/weights.rs @@ -21,11 +21,11 @@ pub(crate) type Weights = Vec; impl Collection { pub fn compute_weights(&mut self, search: &str) -> Result { + let mut anki_progress = self.new_progress_handler::(); let timing = self.timing_today()?; let revlogs = self.revlog_for_srs(search)?; let items = fsrs_items_for_training(revlogs, timing.next_day_at); let fsrs_items = items.len() as u32; - let mut anki_progress = self.new_progress_handler::(); anki_progress.update(false, |p| p.fsrs_items = fsrs_items)?; // adapt the progress handler to our built-in progress handling let progress = ProgressState::new_shared();