diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-28 15:23:27 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-28 15:23:27 -0500 |
commit | 63f531b97fb4c84d5f13ba2312cf08f75d30d01a (patch) | |
tree | 8b857a8a361ead35b145c50caae6c6e0dfa36101 | |
parent | 354d5a8b6648ab15290540abe100a30cce388847 (diff) | |
download | mbsyncloop-63f531b97fb4c84d5f13ba2312cf08f75d30d01a.tar.gz mbsyncloop-63f531b97fb4c84d5f13ba2312cf08f75d30d01a.zip |
fix channel selection
-rwxr-xr-x | mbsyncloop | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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\.\$'"); |