mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
app/vmagent/remotewrite: move sas var initialization closer to the place where it is used
This makes the code sligthtly easier to understand.
This is a follow-up for 1d3d989be5
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5170
This commit is contained in:
parent
1152c30430
commit
b28f904dfa
2 changed files with 2 additions and 3 deletions
|
@ -748,8 +748,6 @@ func (rwctx *remoteWriteCtx) reinitStreamAggr() {
|
|||
return
|
||||
}
|
||||
|
||||
sas := rwctx.sas.Load()
|
||||
|
||||
logger.Infof("reloading stream aggregation configs pointed by -remoteWrite.streamAggr.config=%q", sasFile)
|
||||
metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_streamaggr_config_reloads_total{path=%q}`, sasFile)).Inc()
|
||||
dedupInterval := streamAggrDedupInterval.GetOptionalArg(rwctx.idx)
|
||||
|
@ -760,6 +758,7 @@ func (rwctx *remoteWriteCtx) reinitStreamAggr() {
|
|||
logger.Errorf("cannot reload stream aggregation config from -remoteWrite.streamAggr.config=%q; continue using the previously loaded config; error: %s", sasFile, err)
|
||||
return
|
||||
}
|
||||
sas := rwctx.sas.Load()
|
||||
if !sasNew.Equal(sas) {
|
||||
sasOld := rwctx.sas.Swap(sasNew)
|
||||
sasOld.MustStop()
|
||||
|
|
Loading…
Reference in a new issue