formacao
This commit is contained in:
+4
-3
@@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
@@ -49,7 +48,9 @@ class StreamingApi {
|
||||
done ? controller.close() : controller.enqueue(value);
|
||||
},
|
||||
cancel: () => {
|
||||
this.abort();
|
||||
if (!this.closed) {
|
||||
this.abort();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -71,11 +72,11 @@ class StreamingApi {
|
||||
return new Promise((res) => setTimeout(res, ms));
|
||||
}
|
||||
async close() {
|
||||
this.closed = true;
|
||||
try {
|
||||
await this.writer.close();
|
||||
} catch {
|
||||
}
|
||||
this.closed = true;
|
||||
}
|
||||
async pipe(body) {
|
||||
this.writer.releaseLock();
|
||||
|
||||
Reference in New Issue
Block a user