File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -949,14 +949,22 @@ func (api *API) handleDevcontainerRecreate(w http.ResponseWriter, r *http.Reques
949
949
// The devcontainer state must be set to starting and the asyncWg must be
950
950
// incremented before calling this function.
951
951
func (api * API ) CreateDevcontainer (workspaceFolder , configPath string , opts ... DevcontainerCLIUpOptions ) error {
952
- api .asyncWg .Add (1 )
953
- defer api .asyncWg .Done ()
952
+ api .mu .Lock ()
953
+ if api .closed {
954
+ api .mu .Unlock ()
955
+ return nil
956
+ }
954
957
955
958
dc , found := api .knownDevcontainers [workspaceFolder ]
956
959
if ! found {
960
+ api .mu .Unlock ()
957
961
return xerrors .Errorf ("no devcontainer found" )
958
962
}
959
963
964
+ api .asyncWg .Add (1 )
965
+ defer api .asyncWg .Done ()
966
+ api .mu .Unlock ()
967
+
960
968
var (
961
969
err error
962
970
ctx = api .ctx
You can’t perform that action at this time.
0 commit comments