Skip to content

Commit

Permalink
improve log message for queue* hooks (#3349)
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed May 8, 2024
1 parent 2e6ff61 commit 24fc2d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- avg: repackaged as NPM module #3347
- bounce: repackaged plugin as NPM module #3341
- connection: check remote is connected before queue #3338
- improve log message for queue* hooks, fixes #2998
- support IPv6 when setting remote.is_private #3295
- in setTLS, replace forEach with for...of
- NOTE: remove a handful of 3.0 sunset property names #3315
Expand Down
11 changes: 8 additions & 3 deletions connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,12 @@ class Connection {
});
}
queue_msg (retval, msg) {
if (msg) return msg;
if (msg) {
if (typeof msg === 'object' && msg.constructor.name === 'DSN') {
return msg.reply
}
return msg;
}

switch (retval) {
case constants.ok:
Expand Down Expand Up @@ -1737,7 +1742,7 @@ class Connection {
}
queue_outbound_respond (retval, msg) {
if (this.remote.closed) return;
if (!msg) msg = this.queue_msg(retval, msg) || 'Message Queued';
msg = this.queue_msg(retval, msg) || 'Message Queued';
this.store_queue_result(retval, msg);
msg = `${msg} (${this.transaction.uuid})`;
if (retval !== constants.ok) {
Expand Down Expand Up @@ -1813,7 +1818,7 @@ class Connection {
}
}
queue_respond (retval, msg) {
if (!msg) msg = this.queue_msg(retval, msg);
msg = this.queue_msg(retval, msg);
this.store_queue_result(retval, msg);
msg = `${msg} (${this.transaction.uuid})`;

Expand Down

0 comments on commit 24fc2d3

Please sign in to comment.