diff options
author | Alan Pearce | 2025-03-12 22:39:51 +0100 |
---|---|---|
committer | Alan Pearce | 2025-03-12 22:39:51 +0100 |
commit | 9015baf955c94a806c01b3dcd5648c8e68ad2685 (patch) | |
tree | 5f59386c2ab31b6e45b85576e45a1fc8ae448ae0 /searchix.go | |
parent | 7bb77ff5729cc9434afee895a470fd3b4c12e6d1 (diff) | |
download | searchix-9015baf955c94a806c01b3dcd5648c8e68ad2685.tar.lz searchix-9015baf955c94a806c01b3dcd5648c8e68ad2685.tar.zst searchix-9015baf955c94a806c01b3dcd5648c8e68ad2685.zip |
Diffstat (limited to 'searchix.go')
-rw-r--r-- | searchix.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/searchix.go b/searchix.go index be76af6..1c870df 100644 --- a/searchix.go +++ b/searchix.go @@ -14,7 +14,7 @@ import ( "go.alanpearce.eu/x/log" "github.com/getsentry/sentry-go" - "github.com/pkg/errors" + "gitlab.com/tozd/go/errors" ) func nextUTCOccurrenceOfTime(t config.LocalTime) time.Time { @@ -44,7 +44,7 @@ type IndexOptions struct { Logger *log.Logger } -func (s *Server) SetupIndex(ctx context.Context, options *IndexOptions) error { +func (s *Server) SetupIndex(ctx context.Context, options *IndexOptions) errors.E { var i uint cfgEnabledSources := make([]string, len(s.cfg.Importer.Sources)) for key := range s.cfg.Importer.Sources { @@ -139,7 +139,7 @@ type Server struct { writeIndex *index.WriteIndex } -func New(cfg *config.Config, log *log.Logger) (*Server, error) { +func New(cfg *config.Config, log *log.Logger) (*Server, errors.E) { err := sentry.Init(sentry.ClientOptions{ EnableTracing: true, TracesSampleRate: 1.0, @@ -164,7 +164,7 @@ func (s *Server) startUpdateTimer( ) { const monitorSlug = "import" localHub.WithScope(func(scope *sentry.Scope) { - var err error + var err errors.E scope.SetContext("monitor", sentry.Context{"slug": monitorSlug}) monitorConfig := &sentry.MonitorConfig{ Schedule: sentry.IntervalSchedule(1, sentry.MonitorScheduleUnitDay), @@ -219,8 +219,8 @@ func (s *Server) startUpdateTimer( }) } -func (s *Server) Start(ctx context.Context, liveReload bool) error { - var err error +func (s *Server) Start(ctx context.Context, liveReload bool) errors.E { + var err errors.E s.sv, err = server.New(s.cfg, s.readIndex, s.log.Named("server"), liveReload) if err != nil { return errors.Wrap(err, "error setting up server") |