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

Commitd5e3419

Browse files
authored
revert: fix(agent/agentcontainers): refresh containers before status change (#18624)
Reverts#18620This fix exacerbated the problem, reverting until a better fix can be made.
1 parent7b0b649 commitd5e3419

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

‎agent/agentcontainers/api.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,15 +1002,6 @@ func (api *API) CreateDevcontainer(workspaceFolder, configPath string, opts ...D
10021002

10031003
logger.Info(ctx,"devcontainer created successfully")
10041004

1005-
// Ensure the container list is updated immediately after creation.
1006-
// This makes sure that dc.Container is populated before we acquire
1007-
// the lock avoiding a temporary inconsistency in the API state
1008-
// where status is running, but the container is nil.
1009-
iferr:=api.RefreshContainers(ctx);err!=nil {
1010-
logger.Error(ctx,"failed to trigger immediate refresh after devcontainer creation",slog.Error(err))
1011-
returnxerrors.Errorf("refresh containers: %w",err)
1012-
}
1013-
10141005
api.mu.Lock()
10151006
dc=api.knownDevcontainers[dc.WorkspaceFolder]
10161007
// Update the devcontainer status to Running or Stopped based on the
@@ -1029,6 +1020,13 @@ func (api *API) CreateDevcontainer(workspaceFolder, configPath string, opts ...D
10291020
api.knownDevcontainers[dc.WorkspaceFolder]=dc
10301021
api.mu.Unlock()
10311022

1023+
// Ensure an immediate refresh to accurately reflect the
1024+
// devcontainer state after recreation.
1025+
iferr:=api.RefreshContainers(ctx);err!=nil {
1026+
logger.Error(ctx,"failed to trigger immediate refresh after devcontainer creation",slog.Error(err))
1027+
returnxerrors.Errorf("refresh containers: %w",err)
1028+
}
1029+
10321030
returnnil
10331031
}
10341032

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp