Skip to content

Commit

Permalink
Try to reconnect broken providers before scan (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym authored Sep 11, 2024
1 parent 0917d4f commit 8f8370e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up
asset := batch[i].Asset
runtime := batch[i].Runtime

if err := runtime.EnsureProvidersConnected(); err != nil {
log.Error().Err(err).Msg("could not connect to providers")
}

log.Debug().Interface("platform", asset.Platform).Str("name", asset.Name).Msg("start scan")

// Make sure the context has not been canceled in the meantime. Note that this approach works only for single threaded execution. If we have more than 1 thread calling this function,
Expand Down

0 comments on commit 8f8370e

Please sign in to comment.