Skip to content

Commit

Permalink
Fix panic check for badly behaved storage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Jul 26, 2024
1 parent a7b49c6 commit 367a301
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ func (q *Queue) doFlush(ctx context.Context, entries []*queueItem) {
defer q.inFlightMu.Unlock()

for _, e := range entries {
if e.entry.Index() == nil {
panic(errors.New("Logic error: flush complete, but entry was not assigned an index - did storage fail to call entry.MarshalBundleData?"))
}
e.notify(err)
k := string(e.entry.Identity())
delete(q.inFlight, k)
Expand Down Expand Up @@ -182,6 +179,9 @@ func (e *queueItem) notify(err error) {
if err != nil {
return 0, err
}
if e.entry.Index() == nil {
panic(errors.New("Logic error: flush complete, but entry was not assigned an index - did storage fail to call entry.MarshalBundleData?"))
}
return *e.entry.Index(), nil
}
close(e.c)
Expand Down

0 comments on commit 367a301

Please sign in to comment.