Skip to content

Commit ef18b4d

Browse files
committed
log
1 parent 49a790e commit ef18b4d

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)
@@ -628,6 +628,7 @@ func (s *Store[H]) nextHead(ctx context.Context) (head H, changed bool) {
628628
for ctx.Err() == nil {
629629
h, err := s.getByHeight(ctx, head.Height()+1)
630630
if err != nil {
631+
log.Debugw("next head error", "current", head.Height(), "err", err)
631632
return head, changed
632633
}
633634

@@ -658,6 +659,7 @@ func (s *Store[H]) nextTail(ctx context.Context) (tail H, changed bool) {
658659
for ctx.Err() == nil {
659660
h, err := s.getByHeight(ctx, tail.Height()-1)
660661
if err != nil {
662+
log.Debugw("next tail error", "current", tail.Height(), "err", err)
661663
return tail, changed
662664
}
663665

@@ -673,6 +675,7 @@ func (s *Store[H]) nextTail(ctx context.Context) (tail H, changed bool) {
673675
changed = true
674676
}
675677

678+
log.Debugw("just left next tail", "current", tail.Height(), "err", ctx.Err())
676679
return tail, changed
677680
}
678681

0 commit comments

Comments
 (0)