From 571fdfb2e1b87f6a1fd44e22e17070c5edf4d628 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 28 Dec 2021 15:23:27 -0500 Subject: fix channel selection --- bin/mbsyncloop | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/mbsyncloop b/bin/mbsyncloop index d55806b..4743e92 100755 --- a/bin/mbsyncloop +++ b/bin/mbsyncloop @@ -32,11 +32,18 @@ if (!$pid) { exit; } -my $last = 0; +my $last_all = 0; while (1) { my $now = time; - my $channel = ($now - $last) > 15 * 60 ? "all" : "priority"; - $last = $now; + + my $channel; + if ($now - $last_all > 15 * 60) { + $last_all = $now; + $channel = "all"; + } + else { + $channel = "priority"; + } system("mbsync -c ~/.mbsyncloop $channel") and last; system("notmuch new | grep -v '^No new mail\.\$'"); -- cgit v1.2.3