diff --git a/storage/queue.go b/storage/queue.go index 905fc4a9..4e1e0446 100644 --- a/storage/queue.go +++ b/storage/queue.go @@ -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) @@ -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)