all repos — searchix @ b706b5a3d09983637ea6d5af515733d77b674bdb

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

fix: use importer configured timeout for sentry check-ins

Alan Pearce
commit

b706b5a3d09983637ea6d5af515733d77b674bdb

parent

e7e7d135733e31a6f3d241befd6dcc8e8badf5bf

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

jump to
M searchix.gosearchix.go
@@ -2,6 +2,7 @@ package searchix
import ( "context" + "math" "slices" "sync" "time"
@@ -154,6 +155,7 @@ }
func (s *Server) startUpdateTimer( ctx context.Context, + cfg *config.Config, localHub *sentry.Hub, ) { const monitorSlug = "import"
@@ -161,9 +163,8 @@ localHub.WithScope(func(scope *sentry.Scope) {
var err error scope.SetContext("monitor", sentry.Context{"slug": monitorSlug}) monitorConfig := &sentry.MonitorConfig{ - Schedule: sentry.IntervalSchedule(1, sentry.MonitorScheduleUnitDay), - // minutes - MaxRuntime: 10, + Schedule: sentry.IntervalSchedule(1, sentry.MonitorScheduleUnitDay), + MaxRuntime: int64(math.Ceil(cfg.Importer.Timeout.Minutes())), CheckInMargin: 5, Timezone: time.Local.String(), }
@@ -221,7 +222,7 @@ return errors.Wrap(err, "error setting up server")
} s.wg = &sync.WaitGroup{} - go s.startUpdateTimer(ctx, sentry.CurrentHub().Clone()) + go s.startUpdateTimer(ctx, s.cfg, sentry.CurrentHub().Clone()) s.wg.Add(1) err = s.sv.Start()