Skip to content

Commit

Permalink
fix: logging + memory leakage
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Jun 12, 2024
1 parent b96a3ac commit 27d9932
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ const Logger = ({
}
add(arg) {
const {name, fn} = arg;
this.log('debug', 'Add', name);
this.log('debug', 'Logger', 'Add', name);
super.add(arg);
}
remove(data) {
this.log('debug', 'Remove', data.name);
this.log('debug', 'Logger', 'Remove', data.name);
super.remove(data);
}
async send(data) {
this.log('debug', 'Send', {
this.log('debug', 'Logger', 'Send', {
id: data.id,
method: data.method,
caller: data?.meta?.caller,
Expand All @@ -74,6 +74,7 @@ const Logger = ({
} catch (e) {
this.log(
'error',
'Logger',
'Notify',
e?.error?.stack || e?.stack || e,
args
Expand Down
2 changes: 1 addition & 1 deletion lib/wss.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const Wss = ({
}) {
// maybe reject all requests made on this connection
wsClient.on('close', async() => {
this.remove(connectionId + '.write');
this.remove({name: connectionId + '.write'});
const conn = this.connections.get(connectionId);
try {
await this.notify({
Expand Down

0 comments on commit 27d9932

Please sign in to comment.