Skip to content

Commit fce9482

Browse files
committed
fix: Handle error when sending shutdown signal in Spinner to ensure graceful shutdown
1 parent 010c955 commit fce9482

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/progress/spinner.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ func (s *Spinner) start() {
8282
signal.Stop(s.sigChan)
8383
p, err := os.FindProcess(os.Getpid())
8484
if err == nil {
85-
p.Signal(sig)
85+
if err := p.Signal(sig); err != nil {
86+
// Log the error but continue with the shutdown
87+
fmt.Fprintf(os.Stderr, "Error sending signal: %v\n", err)
88+
}
8689
}
8790
return
8891
}

0 commit comments

Comments
 (0)