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
This commit is contained in:
Ade Attwood 2024-07-23 22:04:07 +01:00
parent 716c605bee
commit f7e9b84d95

View file

@ -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);
}
}));
}