feat: add bounded connection network diagnostics
This commit is contained in:
@@ -130,12 +130,13 @@ export class Provider {
|
||||
}
|
||||
async abortRequests() {
|
||||
this.requestsClosing = true;
|
||||
await this.hub?.networkChecks?.stopAll();
|
||||
const operations = [...(this.requestControllers ?? [])];
|
||||
for (const operation of operations) operation.controller.abort(new Error('用户停止执行宿主。'));
|
||||
await Promise.all(operations.map(operation => operation.done));
|
||||
const transport=this.transport;this.transport=null;await transport?.close();
|
||||
}
|
||||
resumeRequests() { this.requestsClosing = false; }
|
||||
resumeRequests() { this.requestsClosing = false; if (this.hub?.networkChecks) this.hub.networkChecks.closing = false; }
|
||||
modelHub(store) { return this.hub ??= new ModelHub(store, this); }
|
||||
prepareConfig(config, store) { return this.modelHub(store).prepare(config); }
|
||||
redact(value, key = this.apiKey) {
|
||||
|
||||
Reference in New Issue
Block a user