Skip to content

Commit fa15ab8

Browse files
committed
log
1 parent d22cc17 commit fa15ab8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

store/store.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (s *Store[H]) Start(ctx context.Context) error {
134134
return fmt.Errorf("header/store: initializing: %w", err)
135135
}
136136

137-
ctx, cancel := context.WithCancel(ctx)
137+
ctx, cancel := context.WithCancel(context.Background())
138138
s.cancel = cancel
139139

140140
go s.flushLoop(ctx)
@@ -631,6 +631,7 @@ func (s *Store[H]) nextHead(ctx context.Context) (head H, changed bool) {
631631
for ctx.Err() == nil {
632632
h, err := s.getByHeight(ctx, head.Height()+1)
633633
if err != nil {
634+
log.Debugw("next head error", "current", head.Height(), "err", err)
634635
return head, changed
635636
}
636637

@@ -661,6 +662,7 @@ func (s *Store[H]) nextTail(ctx context.Context) (tail H, changed bool) {
661662
for ctx.Err() == nil {
662663
h, err := s.getByHeight(ctx, tail.Height()-1)
663664
if err != nil {
665+
log.Debugw("next tail error", "current", tail.Height(), "err", err)
664666
return tail, changed
665667
}
666668

@@ -676,6 +678,7 @@ func (s *Store[H]) nextTail(ctx context.Context) (tail H, changed bool) {
676678
changed = true
677679
}
678680

681+
log.Debugw("just left next tail", "current", tail.Height(), "err", ctx.Err())
679682
return tail, changed
680683
}
681684

0 commit comments

Comments
 (0)