projects
/
squeep-amqp-helper
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use log-helper fileScope, minor lint fix
[squeep-amqp-helper]
/
lib
/
base.js
diff --git
a/lib/base.js
b/lib/base.js
index 87607daeb6e7c1402feb490c5a0fc5c513ea6f1a..0805d07dff2b4ccf4f30a03e404f8a1bb1eba0d7 100644
(file)
--- a/
lib/base.js
+++ b/
lib/base.js
@@
-1,9
+1,9
@@
'use strict';
const amqp = require('amqplib');
const { isFatalError: isFatalAMQPError } = require('amqplib/lib/connection');
'use strict';
const amqp = require('amqplib');
const { isFatalError: isFatalAMQPError } = require('amqplib/lib/connection');
-const
common = require('./common
');
+const
{ fileScope } = require('@squeep/log-helper
');
-const _fileScope =
common.
fileScope(__filename);
+const _fileScope = fileScope(__filename);
/**
* Base class common to worker publisher and consumer, handling
/**
* Base class common to worker publisher and consumer, handling
@@
-25,7
+25,7
@@
class Base {
*/
constructor(logger, options) {
this.logger = logger;
*/
constructor(logger, options) {
this.logger = logger;
- this.options =
Object.assign(
{
+ this.options = {
url: undefined,
name: 'messages',
prefix: 'squeep',
url: undefined,
name: 'messages',
prefix: 'squeep',
@@
-35,14
+35,16
@@
class Base {
queueType: 'quorum',
retryDelayMs: 10000,
prefetch: 1,
queueType: 'quorum',
retryDelayMs: 10000,
prefetch: 1,
- }, options);
- this.options.socketOptions = Object.assign({
+ ...options,
+ };
+ this.options.socketOptions = {
noDelay: undefined,
timeout: undefined,
keepAlive: undefined,
keepAliveDelay: undefined,
clientProperties: undefined,
noDelay: undefined,
timeout: undefined,
keepAlive: undefined,
keepAliveDelay: undefined,
clientProperties: undefined,
- }, options.socketOptions);
+ ...options.socketOptions,
+ };
this.connection = undefined;
this.channel = undefined;
this.connection = undefined;
this.channel = undefined;
@@
-50,7
+52,7
@@
class Base {
/**
/**
- * Establish the necessary connections to the queue
and lock services
.
+ * Establish the necessary connections to the queue.
*/
async connect() {
const _scope = _fileScope('connect');
*/
async connect() {
const _scope = _fileScope('connect');