From 383ee780613116e78db9114a39a2d6127533463c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Mar 2025 20:49:46 +0100 Subject: feat: show last/next/current indexing run time --- internal/index/index_meta.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/index/index_meta.go') diff --git a/internal/index/index_meta.go b/internal/index/index_meta.go index 635965a..0ff835b 100644 --- a/internal/index/index_meta.go +++ b/internal/index/index_meta.go @@ -118,3 +118,14 @@ func (i *Meta) SetSourceMeta(source string, meta *SourceMeta) { } i.data.Sources[source] = meta } + +func (i *Meta) LastUpdated() time.Time { + var last time.Time + for _, sourceMeta := range i.data.Sources { + if sourceMeta.Updated.After(last) { + last = sourceMeta.Updated + } + } + + return last +} -- cgit 1.4.1