all repos — searchix @ 383ee780613116e78db9114a39a2d6127533463c

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: show last/next/current indexing run time

Alan Pearce
commit

383ee780613116e78db9114a39a2d6127533463c

parent

49e3004d33bf84aa081460e4a6d89a8d84cc12b0

1 file changed, 5 insertions(+), 0 deletions(-)

changed files
M searchix.gosearchix.go
@@ -7,6 +7,7 @@ "slices"
"sync" "time" + "go.alanpearce.eu/searchix/internal/components" "go.alanpearce.eu/searchix/internal/config" "go.alanpearce.eu/searchix/internal/importer" "go.alanpearce.eu/searchix/internal/index"
@@ -125,6 +126,7 @@ }
} } } + components.SetLastUpdated(read.LastUpdated()) return nil }
@@ -175,6 +177,7 @@ }
s.wg.Add(1) nextRun := nextUTCOccurrenceOfTime(s.cfg.Importer.UpdateAt) + components.SetNextRun(nextRun) for { s.log.Debug("scheduling next run", "next-run", nextRun) select {
@@ -192,6 +195,7 @@ eventID := localHub.CaptureCheckIn(&sentry.CheckIn{
MonitorSlug: monitorSlug, Status: sentry.CheckInStatusInProgress, }, monitorConfig) + components.MarkIndexingStarted() imp := importer.New(s.cfg, s.log.Named("importer"), s.writeIndex) err = imp.Start(ctx, false, nil)
@@ -215,6 +219,7 @@ Status: sentry.CheckInStatusOK,
}, monitorConfig) } nextRun = nextRun.AddDate(0, 0, 1) + components.MarkIndexingFinished(nextRun) } }) }