Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/sdkserver/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ func (s *server) execHandler(w http.ResponseWriter, r *http.Request) {

defer func() {
s.runningLock.Lock()
// Need to check if the cancel is still in map. In case when user abort, the channel will be deleted from map and closed already, and closing it again will panic
_, ok := s.running[runID]
if ok {
close(cancel)
}
delete(s.running, runID)
s.runningLock.Unlock()
close(cancel)
}()

// Ensure chat state is not empty.
Expand Down