refactor: 热重载

This commit is contained in:
手瓜一十雪
2024-11-25 15:16:12 +08:00
parent 74a316e758
commit 01d11d6213
3 changed files with 23 additions and 51 deletions

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);