index: support incremental index loading

Do not require a full index reload if only a few additional index files
have been added. This can drastically speed up loading the index in the
mount command.
This commit is contained in:
Michael Eischer
2026-02-18 20:07:12 +01:00
parent b24d210b45
commit 4c0dc9e202
4 changed files with 99 additions and 7 deletions
+3 -1
View File
@@ -26,7 +26,9 @@ func NewCounter(interval time.Duration, total uint64, report Func) *Counter {
c.max.Store(total)
c.Updater = *NewUpdater(interval, func(runtime time.Duration, final bool) {
v, maxV := c.Get()
report(v, maxV, runtime, final)
if report != nil {
report(v, maxV, runtime, final)
}
})
return c
}