From 29476e60adbab7bf8577134c399a05c1ba72e053 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Fri, 22 Nov 2024 11:21:04 +0100 Subject: [PATCH] fix: flush more liberally --- src/event_sender.rs | 2 +- src/tasks.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/event_sender.rs b/src/event_sender.rs index 11a5200..727d9e4 100644 --- a/src/event_sender.rs +++ b/src/event_sender.rs @@ -65,7 +65,7 @@ impl EventSender { })?) } /// Sends all pending events - fn force_flush(&self) { + pub(crate) fn force_flush(&self) { debug!("Flushing {} events from queue", self.queue.borrow().len()); let values = self.clear(); self.url.as_ref().map(|url| { diff --git a/src/tasks.rs b/src/tasks.rs index 3ea255a..7c1f9a7 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -855,7 +855,7 @@ impl TasksRelay { } pub(crate) fn flush(&self) { - self.sender.flush(); + self.sender.force_flush(); } /// Returns ids of tasks matching the given string. @@ -955,7 +955,7 @@ impl TasksRelay { let pos = self.get_position(); if target == pos { debug!("Flushing Tasks because of move in place"); - self.flush(); + self.sender.flush(); return; } @@ -964,7 +964,7 @@ impl TasksRelay { .is_some_and(|t| t.parent_id() == pos.as_ref()) { debug!("Flushing Tasks because of move beyond child"); - self.flush(); + self.sender.flush(); } let now = Timestamp::now();