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

Commitd2df9e1

Browse files
authored
fix: ensure wsep processes are closed (#436)
1 parentedf70b9 commitd2df9e1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎internal/sync/singlefile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func SingleFile(ctx context.Context, local, remoteDir string, workspace *coder.W
3939
iferr!=nil {
4040
returnxerrors.Errorf("start sync command: %w",err)
4141
}
42+
deferprocess.Close()
4243

4344
sourceFile,err:=os.Open(local)
4445
iferr!=nil {

‎internal/sync/sync.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ func (s Sync) remoteCmd(ctx context.Context, prog string, args ...string) error
109109
iferr!=nil {
110110
returnxerrors.Errorf("exec remote process: %w",err)
111111
}
112+
deferprocess.Close()
113+
112114
// NOTE: If the copy routine fail, it will result in `process.Wait` to unblock and report an error.
113115
gofunc() {_,_=io.Copy(s.OutW,process.Stdout()) }()// Best effort.
114116
gofunc() {_,_=io.Copy(s.ErrW,process.Stderr()) }()// Best effort.
@@ -290,6 +292,8 @@ func (s Sync) Version() (string, error) {
290292
iferr!=nil {
291293
return"",err
292294
}
295+
deferprocess.Close()
296+
293297
buf:=&bytes.Buffer{}
294298
_,_=io.Copy(buf,process.Stdout())// Ignore error, if any, it would be handled by the process.Wait return.
295299

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp