From f7e9b84d9585fafc4ae15842054cbd889c9d67b8 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 23 Jul 2024 22:04:07 +0100 Subject: [PATCH] refactor: move log messages to after the sync Summary: When interacting with external programs there is not a lot you can do if the log messages is before the sync. By having the message after the sync this will allow you to update mail indexes when new messages come in. This is used right now with the emacs mu4e plugin. Its used to watch messages then update mu when new messages arrive in a mailbox. Test Plan: This has been used locally for some time now. Its not a functional change anyway. Reviewers: AdeAttwood Reviewed By: AdeAttwood Differential Revision: https://ph.baln.co.uk/D4 --- src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4a80cbe..389c18e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -109,16 +109,12 @@ fn main() { continue; } - log::info!( - "Syncing changes for {} in mailbox {}", - channel_name, - mailbox - ); - Command::new("mbsync") .args(["--all", &format!("{}:{}", channel_name, mailbox)]) .output() .expect("Unable to sync mail"); + + log::info!("Synced changes for {} in mailbox {}", channel_name, mailbox); } })); }