@sebspark/promise-cache 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -113,9 +113,13 @@ var Persistor = class {
113
113
  var _a;
114
114
  try {
115
115
  await new Promise((resolve, reject) => {
116
+ var _a2, _b, _c, _d;
116
117
  this.client = CACHE_CLIENT({
117
- ...this.redis,
118
+ url: (_a2 = this.redis) == null ? void 0 : _a2.url,
119
+ username: (_b = this.redis) == null ? void 0 : _b.username,
120
+ password: (_c = this.redis) == null ? void 0 : _c.password,
118
121
  socket: {
122
+ ...(_d = this.redis) == null ? void 0 : _d.socket,
119
123
  reconnectStrategy: (retries, cause) => {
120
124
  console.error(cause);
121
125
  return 1e3 * 2 ** retries;
@@ -128,11 +132,11 @@ var Persistor = class {
128
132
  this.onSuccess();
129
133
  resolve(true);
130
134
  }).on("reconnecting", () => {
131
- var _a2;
132
- (_a2 = this.logger) == null ? void 0 : _a2.info("reconnecting...", this.clientId);
135
+ var _a3;
136
+ (_a3 = this.logger) == null ? void 0 : _a3.info("reconnecting...", this.clientId);
133
137
  }).on("end", () => {
134
- var _a2;
135
- (_a2 = this.logger) == null ? void 0 : _a2.info("end...", this.clientId);
138
+ var _a3;
139
+ (_a3 = this.logger) == null ? void 0 : _a3.info("end...", this.clientId);
136
140
  });
137
141
  this.client.connect();
138
142
  });
package/dist/index.mjs CHANGED
@@ -93,9 +93,13 @@ var Persistor = class {
93
93
  var _a;
94
94
  try {
95
95
  await new Promise((resolve, reject) => {
96
+ var _a2, _b, _c, _d;
96
97
  this.client = CACHE_CLIENT({
97
- ...this.redis,
98
+ url: (_a2 = this.redis) == null ? void 0 : _a2.url,
99
+ username: (_b = this.redis) == null ? void 0 : _b.username,
100
+ password: (_c = this.redis) == null ? void 0 : _c.password,
98
101
  socket: {
102
+ ...(_d = this.redis) == null ? void 0 : _d.socket,
99
103
  reconnectStrategy: (retries, cause) => {
100
104
  console.error(cause);
101
105
  return 1e3 * 2 ** retries;
@@ -108,11 +112,11 @@ var Persistor = class {
108
112
  this.onSuccess();
109
113
  resolve(true);
110
114
  }).on("reconnecting", () => {
111
- var _a2;
112
- (_a2 = this.logger) == null ? void 0 : _a2.info("reconnecting...", this.clientId);
115
+ var _a3;
116
+ (_a3 = this.logger) == null ? void 0 : _a3.info("reconnecting...", this.clientId);
113
117
  }).on("end", () => {
114
- var _a2;
115
- (_a2 = this.logger) == null ? void 0 : _a2.info("end...", this.clientId);
118
+ var _a3;
119
+ (_a3 = this.logger) == null ? void 0 : _a3.info("end...", this.clientId);
116
120
  });
117
121
  this.client.connect();
118
122
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebspark/promise-cache",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",