(sink *responseSink, exchange *pendingExchange)
| 687 | } |
| 688 | |
| 689 | func (a *copilotRequestAdapter) finishCancelled(sink *responseSink, exchange *pendingExchange) { |
| 690 | exchange.mu.Lock() |
| 691 | finished := exchange.finished |
| 692 | started := exchange.started |
| 693 | exchange.mu.Unlock() |
| 694 | if finished { |
| 695 | return |
| 696 | } |
| 697 | if !started { |
| 698 | _ = sink.start(499, "", http.Header{}) |
| 699 | } |
| 700 | _ = sink.sinkError("Request cancelled by runtime", "cancelled") |
| 701 | } |
| 702 | |
| 703 | func (a *copilotRequestAdapter) removePending(requestID string) { |
| 704 | a.mu.Lock() |
no test coverage detected