@duvdu-v1/duvdu 1.1.62 → 1.1.63

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.
@@ -289,4 +289,4 @@ export declare const redisConnection: (url: string, password: string) => Promise
289
289
  reserve: typeof import("@redis/bloom/dist/commands/top-k/RESERVE");
290
290
  };
291
291
  } & import("redis").RedisModules, import("redis").RedisFunctions, import("redis").RedisScripts>>;
292
- export declare const sessionStore: (url: string, password: string) => RedisStore;
292
+ export declare const sessionStore: (url: string, password: string) => Promise<RedisStore>;
@@ -17,15 +17,20 @@ const connect_redis_1 = __importDefault(require("connect-redis"));
17
17
  const redis_1 = require("redis");
18
18
  const data_base_connections_1 = require("../errors/data-base-connections");
19
19
  const redisConnection = (url, password) => __awaiter(void 0, void 0, void 0, function* () {
20
- const client = (0, redis_1.createClient)({ url, password });
21
- yield client
22
- .connect()
23
- .then(() => console.log(`redis connected in : ${url}`))
24
- .catch(() => {
25
- throw new data_base_connections_1.DatabaseConnectionError(`cannot connect to redis : ${url}`);
26
- });
27
- return client;
20
+ try {
21
+ const client = (0, redis_1.createClient)({ url, password });
22
+ yield client.connect();
23
+ console.log(`Redis connected in : ${url}`);
24
+ return client;
25
+ }
26
+ catch (error) {
27
+ console.error(`Cannot connect to Redis: ${url}`, error);
28
+ throw new data_base_connections_1.DatabaseConnectionError(`Cannot connect to Redis: ${url}`);
29
+ }
28
30
  });
29
31
  exports.redisConnection = redisConnection;
30
- const sessionStore = (url, password) => new connect_redis_1.default({ client: (0, exports.redisConnection)(url, password) });
32
+ const sessionStore = (url, password) => __awaiter(void 0, void 0, void 0, function* () {
33
+ const client = yield (0, exports.redisConnection)(url, password);
34
+ return new connect_redis_1.default({ client });
35
+ });
31
36
  exports.sessionStore = sessionStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.62",
3
+ "version": "1.1.63",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [