mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-20 21:31:02 +02:00
Merge pull request #17081 from prometheus/superq/if_err_nil
tsdb: Fixup err nil checks
This commit is contained in:
commit
8e133e100f
@ -704,8 +704,7 @@ func (h *Head) Init(minValidTime int64) error {
|
||||
snapshotLoaded = true
|
||||
chunkSnapshotLoadDuration = time.Since(start)
|
||||
h.logger.Info("Chunk snapshot loading time", "duration", chunkSnapshotLoadDuration.String())
|
||||
}
|
||||
if err != nil {
|
||||
} else {
|
||||
snapIdx, snapOffset = -1, 0
|
||||
refSeries = make(map[chunks.HeadSeriesRef]*memSeries)
|
||||
|
||||
|
@ -1443,12 +1443,10 @@ func (h *Head) performChunkSnapshot() error {
|
||||
startTime := time.Now()
|
||||
stats, err := h.ChunkSnapshot()
|
||||
elapsed := time.Since(startTime)
|
||||
if err == nil {
|
||||
h.logger.Info("chunk snapshot complete", "duration", elapsed.String(), "num_series", stats.TotalSeries, "dir", stats.Dir)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("chunk snapshot: %w", err)
|
||||
}
|
||||
h.logger.Info("chunk snapshot complete", "duration", elapsed.String(), "num_series", stats.TotalSeries, "dir", stats.Dir)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user