Fix error with non existing close on adapter
This commit is contained in:
@ -373,19 +373,19 @@ export class LoggingBase extends LoggingInterface {
|
||||
if (this.#closed) return;
|
||||
this.#closed = true;
|
||||
|
||||
this.#adapters.forEach((adapter) => {
|
||||
for (const adapter of this.#adapters) {
|
||||
const cnt = LoggingBase[InitialisedAdapters].get(adapter);
|
||||
if (!cnt) {
|
||||
//TODO: should not happen!
|
||||
} else {
|
||||
if (cnt <= 1) {
|
||||
adapter.close();
|
||||
if (adapter.close) await adapter.close();
|
||||
LoggingBase[InitialisedAdapters].delete(adapter);
|
||||
} else {
|
||||
LoggingBase[InitialisedAdapters].set(adapter, cnt - 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user