Skip to content

Commit

Permalink
add contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi committed Jan 2, 2025
1 parent 5feceb1 commit e0d6b28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/abstractions/shell/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@ func (g *shellGroup) ShellConnect(ctx echo.Context) error {
return nil
case <-clientCtx.Done():
return nil
case <-g.ss.ctx.Done():
return nil
}
}
4 changes: 4 additions & 0 deletions pkg/abstractions/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ func (ss *SSHShellService) keepAlive(ctx context.Context, containerId string, do

for {
select {
case <-ss.ctx.Done():
return
case <-ctx.Done():
return
case <-done:
Expand All @@ -317,6 +319,8 @@ func (ss *SSHShellService) waitForContainer(ctx context.Context, containerId str

for {
select {
case <-ss.ctx.Done():
return nil
case <-timeoutCtx.Done():
return fmt.Errorf("timed out waiting for container to be available")
default:
Expand Down

0 comments on commit e0d6b28

Please sign in to comment.