mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
pass error up if WALWathcer.segments() return err (#5741)
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
This commit is contained in:
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…
Reference in a new issue