mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 04:15:54 +02:00
enhance: Move info outside for loop
This commit is contained in:
parent
38810df96b
commit
f04b51ba10
1 changed files with 1 additions and 1 deletions
|
@ -585,6 +585,7 @@ func (d *DockerSource) WatchContainer(ctx context.Context, monitChan chan *Conta
|
||||||
// Multiple retry attempts within the error case
|
// Multiple retry attempts within the error case
|
||||||
retries := 0
|
retries := 0
|
||||||
|
|
||||||
|
d.logger.Infof("Attempting to reconnect to Docker events stream")
|
||||||
for {
|
for {
|
||||||
// Check for cancellation before sleeping
|
// Check for cancellation before sleeping
|
||||||
select {
|
select {
|
||||||
|
@ -610,7 +611,6 @@ func (d *DockerSource) WatchContainer(ctx context.Context, monitChan chan *Conta
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to reconnect
|
// Try to reconnect
|
||||||
d.logger.Infof("Attempting to reconnect to Docker events stream")
|
|
||||||
newEventsChan, newErrChan := d.Client.Events(ctx, options)
|
newEventsChan, newErrChan := d.Client.Events(ctx, options)
|
||||||
|
|
||||||
// Check if connection is immediately broken
|
// Check if connection is immediately broken
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue