projects
/
websub-hub
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'v1.3-dev'
[websub-hub]
/
src
/
db
/
postgres
/
listener.js
diff --git
a/src/db/postgres/listener.js
b/src/db/postgres/listener.js
index 4baf5d082de3bc1d507ef441ddc795af014e8470..1ce3b3b3a99616ac8a645bcd3b7686ffa8dcc967 100644
(file)
--- a/
src/db/postgres/listener.js
+++ b/
src/db/postgres/listener.js
@@
-23,7
+23,10
@@
class PostgresListener {
this.logger = logger;
this.db = db;
this.logger = logger;
this.db = db;
- this.options = Object.assign({}, defaultOptions, options);
+ this.options = {
+ ...defaultOptions,
+ ...options,
+ };
this.notificationEventName = 'notification';
this.connection = null;
this.notificationEventName = 'notification';
this.connection = null;
@@
-83,7
+86,7
@@
class PostgresListener {
/**
* Notify callback.
/**
* Notify callback.
- * @param {
Object} data
+ * @param {
object} data listener notification
*/
async _onNotification(data) {
const _scope = _fileScope('_onNotification');
*/
async _onNotification(data) {
const _scope = _fileScope('_onNotification');
@@
-98,8
+101,8
@@
class PostgresListener {
/**
* Notify callback and attempt to reconnect.
/**
* Notify callback and attempt to reconnect.
- * @param {*} error
- * @param {*} event
+ * @param {*} error
error
+ * @param {*} event
event
*/
async _onConnectionLost(error, event) {
const _scope = _fileScope('_onConnectionLost');
*/
async _onConnectionLost(error, event) {
const _scope = _fileScope('_onConnectionLost');
@@
-122,8
+125,8
@@
class PostgresListener {
/**
* Schedule an attempt to establish a connection.
/**
* Schedule an attempt to establish a connection.
- * @param {
Number}
delay
- * @param {
Number} retriesRemaining
+ * @param {
number} delay reconnect
delay
+ * @param {
number} retriesRemaining retry countdown
*/
async _reconnect(delay, retriesRemaining) {
const _scope = _fileScope('_reconnect');
*/
async _reconnect(delay, retriesRemaining) {
const _scope = _fileScope('_reconnect');