Browse Source

clean up codes

pull/5805/head
ranbo chen 7 years ago committed by Your Name
parent
commit
19340a382d
  1. 5
      wal.go
  2. 2
      wal_test.go

5
wal.go

@ -714,10 +714,7 @@ func (w *SegmentWAL) Close() error {
return errors.Wrapf(hf.Close(), "closing WAL head %s", hf.Name())
}
if w.dirFile != nil {
w.dirFile.Close()
}
return nil
return w.dirFile.Close()
}
const (

2
wal_test.go

@ -273,7 +273,7 @@ func TestWALRestoreCorrupted_invalidSegment(t *testing.T) {
Ok(t, err)
f2, err := wal.createSegmentFile(dir + "/000002")
Ok(t, err)
Ok(t, f2.Close()) // close for windows!
Ok(t, f2.Close())
// Make header of second segment invalid.
_, err = f.WriteAt([]byte{1, 2, 3, 4}, 0)

Loading…
Cancel
Save