diff options
author | Alan Pearce | 2025-03-19 20:49:46 +0100 |
---|---|---|
committer | Alan Pearce | 2025-03-19 20:51:40 +0100 |
commit | 383ee780613116e78db9114a39a2d6127533463c (patch) | |
tree | c07e2af7ae910d5c6f80836dce8457ba44c54ceb /internal/index/index_meta.go | |
parent | 49e3004d33bf84aa081460e4a6d89a8d84cc12b0 (diff) | |
download | searchix-383ee780613116e78db9114a39a2d6127533463c.tar.lz searchix-383ee780613116e78db9114a39a2d6127533463c.tar.zst searchix-383ee780613116e78db9114a39a2d6127533463c.zip |
feat: show last/next/current indexing run time
Diffstat (limited to 'internal/index/index_meta.go')
-rw-r--r-- | internal/index/index_meta.go | 11 |
1 files changed, 11 insertions, 0 deletions
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 +} |