refactor: 热重载

This commit is contained in:
手瓜一十雪 committed 2024-11-25 15:16:12 +08:00
1 parent 3565cb835f
commit cabc06dd81
3 files changed
+23 -51

No files matched your search

+8
View File
@@ -68,6 +68,14 @@ export class OB11NetworkManager {
await adapter.close();
}
}
async closeSomeAdaterWhenOpen(adaptersToClose: IOB11NetworkAdapter[]) {
for (const adapter of adaptersToClose) {
this.adapters.delete(adapter.name);
if(adapter.isEnable){
await adapter.close();
}
}
}
findSomeAdapter(name: string) {
return this.adapters.get(name);