@keyv/redis 4.3.1 → 4.3.2

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.cjs CHANGED
@@ -177,8 +177,12 @@ var KeyvRedis = class extends import_node_events.default {
177
177
  * Get the Redis URL used to connect to the server. This is used to get a connected client.
178
178
  */
179
179
  async getClient() {
180
- if (!this._client.isOpen) {
181
- await this._client.connect();
180
+ try {
181
+ if (!this._client.isOpen) {
182
+ await this._client.connect();
183
+ }
184
+ } catch (error) {
185
+ this.emit("error", error);
182
186
  }
183
187
  return this._client;
184
188
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import EventEmitter from 'node:events';
2
- import { RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts, RedisClientOptions, RedisClusterOptions } from 'redis';
2
+ import { RedisClientOptions, RedisClusterOptions, RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts } from 'redis';
3
3
  export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, createClient, createCluster } from 'redis';
4
4
  import { KeyvStoreAdapter, KeyvEntry, Keyv } from 'keyv';
5
5
  export { Keyv } from 'keyv';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import EventEmitter from 'node:events';
2
- import { RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts, RedisClientOptions, RedisClusterOptions } from 'redis';
2
+ import { RedisClientOptions, RedisClusterOptions, RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts } from 'redis';
3
3
  export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, createClient, createCluster } from 'redis';
4
4
  import { KeyvStoreAdapter, KeyvEntry, Keyv } from 'keyv';
5
5
  export { Keyv } from 'keyv';
package/dist/index.js CHANGED
@@ -147,8 +147,12 @@ var KeyvRedis = class extends EventEmitter {
147
147
  * Get the Redis URL used to connect to the server. This is used to get a connected client.
148
148
  */
149
149
  async getClient() {
150
- if (!this._client.isOpen) {
151
- await this._client.connect();
150
+ try {
151
+ if (!this._client.isOpen) {
152
+ await this._client.connect();
153
+ }
154
+ } catch (error) {
155
+ this.emit("error", error);
152
156
  }
153
157
  return this._client;
154
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyv/redis",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Redis storage adapter for Keyv",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",