diff --git a/internal/usage/feed.go b/internal/usage/feed.go index c726d6271..a7f402088 100644 --- a/internal/usage/feed.go +++ b/internal/usage/feed.go @@ -482,6 +482,9 @@ func feedLoad() { feed.entries = map[string]*feedEntry{} feed.seq, feed.floor, feed.lines, feed.memo = 0, 0, 0, nil feed.failure = nil + // a journal read anew hasn't been pruned: when the last one was is + // another journal's, and a clock behind it would hold this one's prune off + feed.pruned = time.Time{} fresh := func() { feed.entries = map[string]*feedEntry{} feed.seq, feed.floor, feed.lines = 0, 0, 0 diff --git a/internal/usage/window_holds_carry.go b/internal/usage/window_holds_carry.go index 8d4ecde3b..d6751dc51 100644 --- a/internal/usage/window_holds_carry.go +++ b/internal/usage/window_holds_carry.go @@ -38,7 +38,9 @@ func carryPath() string { return filepath.Join(filepath.Dir(provider.Path()), "w // (they are only a fallback), and is written over when the next is told. func carryLoad() map[string]carried { if p := carryPath(); carry.m == nil || carry.path != p { - carry.path, carry.m, carry.dirty = p, map[string]carried{}, false + // a new file has never been written: what was last written went to + // the old one, so the next save mustn't wait on it + carry.path, carry.m, carry.dirty, carry.wroteAt = p, map[string]carried{}, false, time.Time{} if b, err := os.ReadFile(p); err == nil { var m map[string]carried if json.Unmarshal(b, &m) == nil && m != nil {