Skip to content

Commit

Permalink
chore(process): add ctx.Done() to break select
Browse files Browse the repository at this point in the history
  • Loading branch information
kestrelcjx committed Nov 20, 2021
1 parent db054ec commit 3b61bb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er
})
fileExists[fileName] = true
}
case <-ctx.Done():
return files, nil
}
}

Expand Down
2 changes: 2 additions & 0 deletions v3/process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er
})
fileExists[fileName] = true
}
case <-ctx.Done():
return files, nil
}
}

Expand Down

0 comments on commit 3b61bb2

Please sign in to comment.