aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-29 03:42:04 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-29 03:42:04 -0500
commit19e944011d0d60e2c1c5d90e659c99b842383be4 (patch)
treea3ba3f16e464124d502b877c7ee86bd2baee6696
parent63f531b97fb4c84d5f13ba2312cf08f75d30d01a (diff)
downloadmbsyncloop-19e944011d0d60e2c1c5d90e659c99b842383be4.tar.gz
mbsyncloop-19e944011d0d60e2c1c5d90e659c99b842383be4.zip
failure to update shouldn't cause the loop to exit
-rwxr-xr-xmbsyncloop6
1 files changed, 4 insertions, 2 deletions
diff --git a/mbsyncloop b/mbsyncloop
index 4743e92..a00dc59 100755
--- a/mbsyncloop
+++ b/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);
}