diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-28 14:42:44 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-28 14:42:44 -0500 |
commit | 0c1afe7ff006aa73a1618c68fbea53ba8fd93992 (patch) | |
tree | e85d881cc35d4e692385f2c6babcd74720c24990 | |
parent | 3267f82074579900a4dcebc40a757d2909fd6341 (diff) | |
download | mbsyncloop-0c1afe7ff006aa73a1618c68fbea53ba8fd93992.tar.gz mbsyncloop-0c1afe7ff006aa73a1618c68fbea53ba8fd93992.zip |
be slightly more aggressive about syncing
-rwxr-xr-x | mbsyncloop | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -32,11 +32,13 @@ if (!$pid) { exit; } -my $i = 0; +my $last = 0; while (1) { - my $channel = $i % 15 ? "priority" : "all"; + my $now = time; + my $channel = ($now - $last) > 15 * 60 ? "all" : "priority"; + $last = $now; + system("mbsync -c ~/.mbsyncloop $channel") and last; system("notmuch new") and last; - sleep 60; - $i++; + sleep 60 - (time - $now); } |