mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/storage: prevent from clobbering nin-nil lastError in Storage.add
This commit is contained in:
parent
afecb34491
commit
ad4cb9f3ca
1 changed files with 2 additions and 2 deletions
|
@ -1038,8 +1038,8 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra
|
|||
if err := s.tb.AddRows(rows); err != nil {
|
||||
lastError = fmt.Errorf("cannot add rows to table: %s", err)
|
||||
}
|
||||
if err := s.updatePerDateData(rows, lastError); err != nil {
|
||||
lastError = err
|
||||
if err := s.updatePerDateData(rows, lastError); err != nil lastError == nil {
|
||||
lastError = fmt.Errorf("cannot update per-date data: %s", err)
|
||||
}
|
||||
if lastError != nil {
|
||||
return rows, fmt.Errorf("error occurred during rows addition: %s", lastError)
|
||||
|
|
Loading…
Reference in a new issue