Commit de9acf7a authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

op-dispute-mon: Fix order of initing components (#9455)

Avoids a nil pointer reference.
Use capitals at the start of log messages.
Log when games have been updated to confirm that the app is doing something.
parent 2624af45
...@@ -92,6 +92,7 @@ func (d *detector) Detect(ctx context.Context, games []types.GameMetadata) { ...@@ -92,6 +92,7 @@ func (d *detector) Detect(ctx context.Context, games []types.GameMetadata) {
} }
d.metrics.RecordGamesStatus(statBatch.inProgress, statBatch.defenderWon, statBatch.challengerWon) d.metrics.RecordGamesStatus(statBatch.inProgress, statBatch.defenderWon, statBatch.challengerWon)
d.recordBatch(detectBatch) d.recordBatch(detectBatch)
d.logger.Info("Completed updating games", "count", len(games))
} }
func (d *detector) recordBatch(batch detectionBatch) { func (d *detector) recordBatch(batch detectionBatch) {
......
...@@ -77,8 +77,8 @@ func (s *Service) initFromConfig(ctx context.Context, cfg *config.Config) error ...@@ -77,8 +77,8 @@ func (s *Service) initFromConfig(ctx context.Context, cfg *config.Config) error
if err := s.initOutputRollupClient(ctx, cfg); err != nil { if err := s.initOutputRollupClient(ctx, cfg); err != nil {
return fmt.Errorf("failed to init rollup client: %w", err) return fmt.Errorf("failed to init rollup client: %w", err)
} }
s.initDetector()
s.initMetadataCreator() s.initMetadataCreator()
s.initDetector()
s.initMonitor(ctx, cfg) s.initMonitor(ctx, cfg)
s.metrics.RecordInfo(version.SimpleWithMeta) s.metrics.RecordInfo(version.SimpleWithMeta)
...@@ -180,10 +180,10 @@ func (s *Service) initMonitor(ctx context.Context, cfg *config.Config) { ...@@ -180,10 +180,10 @@ func (s *Service) initMonitor(ctx context.Context, cfg *config.Config) {
} }
func (s *Service) Start(ctx context.Context) error { func (s *Service) Start(ctx context.Context) error {
s.logger.Info("starting scheduler") s.logger.Info("Starting scheduler")
s.logger.Info("starting monitoring") s.logger.Info("Starting monitoring")
s.monitor.StartMonitoring() s.monitor.StartMonitoring()
s.logger.Info("dispute monitor game service start completed") s.logger.Info("Dispute monitor game service start completed")
return nil return nil
} }
...@@ -192,7 +192,7 @@ func (s *Service) Stopped() bool { ...@@ -192,7 +192,7 @@ func (s *Service) Stopped() bool {
} }
func (s *Service) Stop(ctx context.Context) error { func (s *Service) Stop(ctx context.Context) error {
s.logger.Info("stopping dispute mon service") s.logger.Info("Stopping dispute mon service")
var result error var result error
if s.pprofService != nil { if s.pprofService != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment