File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
extension/completions-core/vscode-node/lib/src/openai Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -738,7 +738,7 @@ export class LiveOpenAIFetcher extends OpenAIFetcher {
738738 try {
739739 // Destroy the stream so that the server is hopefully notified we don't want any more data
740740 // and can cancel/forget about the request itself.
741- responseStream . destroy ( ) ;
741+ await responseStream . destroy ( ) ;
742742 } catch ( e ) {
743743 this . instantiationService . invokeFunction ( acc => logger . exception ( acc , e , `Error destroying stream` ) ) ;
744744 }
Original file line number Diff line number Diff line change @@ -70,12 +70,12 @@ export class ResponseStream {
7070 /**
7171 * @throws client of the method should handle the error
7272 */
73- public destroy ( ) : void {
74- const body = this . fetcherResponse . body ( ) ;
73+ public async destroy ( ) : Promise < void > {
74+ const body = await this . fetcherResponse . body ( ) ;
7575 // Destroy the stream so that the server is hopefully notified we don't want any more data
7676 // and can cancel/forget about the request itself.
77- if ( body && 'destroy' in body && typeof body . destroy === 'function' ) {
78- ( body as unknown as ClientHttp2Stream ) . destroy ( ) ;
77+ if ( body && typeof ( body as ClientHttp2Stream ) . destroy === 'function' ) {
78+ ( body as ClientHttp2Stream ) . destroy ( ) ;
7979 } else if ( body instanceof ReadableStream ) {
8080 void body . cancel ( ) ;
8181 }
You can’t perform that action at this time.
0 commit comments