Skip to content

Commit ff52a92

Browse files
authored
Undelete delete browsers from Invocation cancellation (#16)
<!-- mesa-description-start --> ## TL;DR Restores the logic to delete browsers when an invocation is cancelled. ## Why we made these changes This fixes a regression where cancelling an invocation would leave orphaned browser instances running, consuming unnecessary resources. This change ensures proper resource cleanup. ## What changed? - In `cmd/invoke.go`, the invocation cancellation handler now calls `client.Invocations.DeleteBrowsers` with a 30-second timeout to ensure associated browsers are properly terminated. <sup>_Description generated by Mesa. [Update settings](https://app.mesa.dev/onkernel/settings/pull-requests)_</sup> <!-- mesa-description-end -->
1 parent fa40463 commit ff52a92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/invoke.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func runInvoke(cmd *cobra.Command, args []string) error {
110110
); err != nil {
111111
pterm.Error.Printf("Failed to mark invocation as failed: %v\n", err)
112112
}
113+
if err := client.Invocations.DeleteBrowsers(context.Background(), resp.ID, option.WithRequestTimeout(30*time.Second)); err != nil {
114+
pterm.Error.Printf("Failed to cancel invocation: %v\n", err)
115+
}
113116
})
114117
})
115118

0 commit comments

Comments
 (0)