]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watch: flush changes to inbox before updating IMAPTracker
authorEric Wong <e@yhbt.net>
Fri, 28 Aug 2020 10:12:58 +0000 (10:12 +0000)
committerEric Wong <e@yhbt.net>
Fri, 28 Aug 2020 22:19:25 +0000 (22:19 +0000)
Data needs to hit inboxes, first.  Otherwise it's possible to
skip messages in case git-fast-import is killed before it sees
"done\n".  Now, -watch will just waste a little bandwidth in
re-downloading a seen message if it's interrupted immediately
before updating IMAPTracker.

lib/PublicInbox/WatchMaildir.pm

index 4ae400f7905fdb203fd3fa69507634e243b9c5c5..78aec8a25d5f4b6cfd3103917ecc93aed6ba2a7b 100644 (file)
@@ -918,8 +918,8 @@ sub nntp_fetch_all ($$$) {
                }
                $last_art = $art;
        }
                }
                $last_art = $art;
        }
-       $itrk->update_last(0, $last_art) if defined $last_art;
        _done_for_now($self);
        _done_for_now($self);
+       $itrk->update_last(0, $last_art) if defined $last_art;
        $err;
 }
 
        $err;
 }