pass error up if WALWathcer.segments() return err (#5741)

Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
pull/5775/head
Yao Zengzeng 5 years ago committed by Tom Wilkie
parent abdcbda82a
commit 3cde8a9941

@ -234,7 +234,7 @@ func (w *WALWatcher) run() error {
func (w *WALWatcher) findSegmentForIndex(index int) (int, error) {
refs, err := w.segments(w.walDir)
if err != nil {
return -1, nil
return -1, err
}
for _, r := range refs {
@ -249,7 +249,7 @@ func (w *WALWatcher) findSegmentForIndex(index int) (int, error) {
func (w *WALWatcher) firstAndLast() (int, int, error) {
refs, err := w.segments(w.walDir)
if err != nil {
return -1, -1, nil
return -1, -1, err
}
if len(refs) == 0 {

Loading…
Cancel
Save