diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-29 03:42:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-29 03:42:04 -0500 |
commit | 645d971a3ad6b39f35ad679d2c187e85385206bb (patch) | |
tree | 4c0325a6df13dfdcb158feb76798fddf44e13b6b | |
parent | 571fdfb2e1b87f6a1fd44e22e17070c5edf4d628 (diff) | |
download | conf-645d971a3ad6b39f35ad679d2c187e85385206bb.tar.gz conf-645d971a3ad6b39f35ad679d2c187e85385206bb.zip |
failure to update shouldn't cause the loop to exit
-rwxr-xr-x | bin/mbsyncloop | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/mbsyncloop b/bin/mbsyncloop index 4743e92..a00dc59 100755 --- a/bin/mbsyncloop +++ b/bin/mbsyncloop @@ -38,14 +38,16 @@ while (1) { my $channel; if ($now - $last_all > 15 * 60) { - $last_all = $now; $channel = "all"; } else { $channel = "priority"; } - system("mbsync -c ~/.mbsyncloop $channel") and last; + my $status = system("mbsync -c ~/.mbsyncloop $channel"); + if ($status == 0 && $channel eq "all") { + $last_all = $now; + } system("notmuch new | grep -v '^No new mail\.\$'"); sleep 60 - (time - $now); } |