Skip to content

Commit

Permalink
Add additional context cancellation location
Browse files Browse the repository at this point in the history
While an improved ability to detect Ctrl+C context cancellation was added in #933 I was noticing in this branch that when using the `--show-details` output after pressing Ctrl+C I would still see a lot
of extra output displayed about data files being processed that were actually getting skipped so this helps to add an extra cancellation check to avoid that unneeded output.
  • Loading branch information
orware committed Nov 7, 2024
1 parent bd304c5 commit 8426c12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/dumper/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func (l *Loader) Run(ctx context.Context) error {
numberOfDataFiles := len(files.tables)

for idx, table := range files.tables {
// Allows for quicker exit when using Ctrl+C at the Terminal:
if ctx.Err() != nil {
return ctx.Err()
}

table := table
conn := pool.Get()

Expand Down

0 comments on commit 8426c12

Please sign in to comment.