Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

fix: ensure wsep processes are closed#436

Merged
coadler merged 1 commit intomainfromcolin/wsep-close
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsinternal/sync/singlefile.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@ func SingleFile(ctx context.Context, local, remoteDir string, workspace *coder.W
if err != nil {
return xerrors.Errorf("start sync command: %w", err)
}
defer process.Close()

sourceFile, err := os.Open(local)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletionsinternal/sync/sync.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,6 +109,8 @@ func (s Sync) remoteCmd(ctx context.Context, prog string, args ...string) error
if err != nil {
return xerrors.Errorf("exec remote process: %w", err)
}
defer process.Close()

// NOTE: If the copy routine fail, it will result in `process.Wait` to unblock and report an error.
go func() { _, _ = io.Copy(s.OutW, process.Stdout()) }() // Best effort.
go func() { _, _ = io.Copy(s.ErrW, process.Stderr()) }() // Best effort.
Expand DownExpand Up@@ -290,6 +292,8 @@ func (s Sync) Version() (string, error) {
if err != nil {
return "", err
}
defer process.Close()

buf := &bytes.Buffer{}
_, _ = io.Copy(buf, process.Stdout()) // Ignore error, if any, it would be handled by the process.Wait return.

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp