nats-hemera
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -31,2 +31,4 @@ 'use strict' | ||
this.actMeta.middleware = addDef.middleware || [] | ||
// only used for maxMessages$ flag | ||
this._receivedMsg = 0 | ||
} | ||
@@ -33,0 +35,0 @@ |
@@ -25,3 +25,13 @@ const Joi = require('joi') | ||
// Custom logger | ||
logger: Joi.object().optional(), | ||
logger: Joi.object() | ||
.keys({ | ||
info: Joi.func().minArity(1), | ||
error: Joi.func().minArity(1), | ||
debug: Joi.func().minArity(1), | ||
fatal: Joi.func().minArity(1), | ||
warn: Joi.func().minArity(1), | ||
trace: Joi.func().minArity(1), | ||
child: Joi.func().minArity(1) | ||
}) | ||
.requiredKeys('info', 'error', 'debug', 'fatal', 'warn', 'trace'), | ||
// The error serialization options | ||
@@ -28,0 +38,0 @@ errio: Joi.object() |
@@ -169,7 +169,17 @@ 'use strict' | ||
context.matchedAction = context._router.lookup(context._pattern) | ||
// fallback to notFound action when defined | ||
if (!context.matchedAction && context._notFoundPattern) { | ||
// remove pattern when maxMessages$ was received | ||
// only relevant for server actions with custom transport options | ||
if (context.matchedAction) { | ||
context.matchedAction._receivedMsg++ | ||
if ( | ||
context.matchedAction._receivedMsg === | ||
context.matchedAction.transport.maxMessages | ||
) { | ||
// we only need remove pattern the subscription is unsubscribed by nats driver | ||
context.cleanTopic(context._topic) | ||
} | ||
} else if (context._notFoundPattern) { | ||
// fallback to notFound action when defined | ||
context.matchedAction = context._router.lookup(context._notFoundPattern) | ||
} | ||
context.emit('serverPreRequest', context) | ||
@@ -176,0 +186,0 @@ |
{ | ||
"name": "nats-hemera", | ||
"author": "Dustin Deus (https://github.com/StarpTech)", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://hemerajs.github.io/hemera/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76356
3068