Skip to content

Commit

Permalink
🐛 make sure providers are not killed after an asset is scanned (#1663)
Browse files Browse the repository at this point in the history
This makes sure that scans for a list of assets work. The current
implementation would kill the provider after the first asset is scanned.
We do a simple fix here that will only kill open providers after the
whole scan is complete. As a long term fix we should probably look into
keeping track of assets that need a specific provider. Only when all
assets for the provider have been scanned, it can be killed.

Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Sep 7, 2023
1 parent 12f4f7e commit 233b0b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions explorer/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up
multiprogress.Open()
}()
scanGroup.Wait()
providers.Coordinator.Shutdown()
return reporter.Reports(), finished, nil
}

Expand Down
3 changes: 2 additions & 1 deletion providers/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (r *Runtime) Close() {
log.Error().Err(err).Msg("failed to save recording")
}

r.coordinator.Close(r.Provider.Instance)
// TODO: ideally, we try to close the provider here but only if there are no more assets that need it
// r.coordinator.Close(r.Provider.Instance)
r.schema.Close()
}

Expand Down

0 comments on commit 233b0b4

Please sign in to comment.