Skip to content

Commit

Permalink
defer release container on err
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Suraci <alex@dagger.io>
  • Loading branch information
vito committed Jul 18, 2023
1 parent 51f5751 commit 81bbdab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ func (svc *Service) Start(ctx context.Context, gw bkgw.Client, progSock *Socket)
return nil, err
}

defer func() {
if err != nil {
gc.Release(context.Background())
}
}()

checked := make(chan error, 1)
go func() {
checked <- health.Check(ctx)
Expand Down

0 comments on commit 81bbdab

Please sign in to comment.