bugfix: reuse error var in remoteWriteProm (#741)
* fix: reuse error var when remoteWritePost * add debug log * remove logs
This commit is contained in:
parent
ae4f20bca1
commit
c0b42cf29a
|
@ -225,20 +225,21 @@ func (pd *PromeDataSource) processWrite(payload []byte) {
|
|||
for _, c := range pd.WriteTargets {
|
||||
newC := c
|
||||
go func(cc *HttpClient, payload []byte) {
|
||||
|
||||
sendOk := false
|
||||
var err error
|
||||
var rec bool
|
||||
for i := 0; i < retry; i++ {
|
||||
err := remoteWritePost(cc, payload)
|
||||
err = remoteWritePost(cc, payload)
|
||||
if err == nil {
|
||||
sendOk = true
|
||||
break
|
||||
}
|
||||
err, ok := err.(RecoverableError)
|
||||
|
||||
if !ok {
|
||||
err, rec = err.(RecoverableError)
|
||||
if !rec {
|
||||
break
|
||||
}
|
||||
|
||||
logger.Warningf("send prome fail: %v", err)
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue