File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -359,20 +359,22 @@ func (f *Fluent) write(msg *msgToSend) error {
359359 for i := 0 ; i < f .Config .MaxRetry ; i ++ {
360360
361361 // Connect if needed
362- f .muconn .Lock ()
363362 if f .conn == nil {
364- err := f .connect ()
365- if err != nil {
366- f .muconn .Unlock ()
367- waitTime := f .Config .RetryWait * e (defaultReconnectWaitIncreRate , float64 (i - 1 ))
368- if waitTime > f .Config .MaxRetryWait {
369- waitTime = f .Config .MaxRetryWait
363+ f .muconn .Lock ()
364+ if f .conn == nil {
365+ err := f .connect ()
366+ if err != nil {
367+ f .muconn .Unlock ()
368+ waitTime := f .Config .RetryWait * e (defaultReconnectWaitIncreRate , float64 (i - 1 ))
369+ if waitTime > f .Config .MaxRetryWait {
370+ waitTime = f .Config .MaxRetryWait
371+ }
372+ time .Sleep (time .Duration (waitTime ) * time .Millisecond )
373+ continue
370374 }
371- time .Sleep (time .Duration (waitTime ) * time .Millisecond )
372- continue
373375 }
376+ f .muconn .Unlock ()
374377 }
375- f .muconn .Unlock ()
376378
377379 // We're connected, write msg
378380 t := f .Config .WriteTimeout
You can’t perform that action at this time.
0 commit comments