From bbcadcb5d1644c49da7d86187ef9affd33f95da2 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Mon, 21 Nov 2022 18:09:08 +0100 Subject: threaded watcher creation and arg for config new argument `polling` allows to force watcher to use polling instead of file system events. this should address the issue in #1436 and maybe even #1437 --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 6563a372..6a45b857 100644 --- a/src/main.rs +++ b/src/main.rs @@ -150,6 +150,7 @@ fn main() -> Result<()> { theme, key_config.clone(), &input, + cliargs.poll_watcher, &mut terminal, )?; @@ -170,13 +171,17 @@ fn run_app( theme: Theme, key_config: KeyConfig, input: &Input, + poll_watcher: bool, terminal: &mut Terminal>, ) -> Result { let (tx_git, rx_git) = unbounded(); let (tx_app, rx_app) = unbounded(); let rx_input = input.receiver(); - let watcher = RepoWatcher::new(repo_work_dir(&repo)?.as_str())?; + let watcher = RepoWatcher::new( + repo_work_dir(&repo)?.as_str(), + poll_watcher, + ); let rx_watcher = watcher.receiver(); let spinner_ticker = tick(SPINNER_INTERVAL); -- cgit v1.2.3