diff --git a/CHANGELOG.md b/CHANGELOG.md index 756c350..443fcea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2 (February 7th, 2022) + +- up dependencies + ## 0.1.1 (September 13th, 2021) - up dependencies diff --git a/package-lock.json b/package-lock.json index 1e97f5b..c353d37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@restorecommerce/resource-srv", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@restorecommerce/resource-srv", - "version": "0.1.1", + "version": "0.1.2", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -16,7 +16,7 @@ "@restorecommerce/grpc-client": "^0.2.14", "@restorecommerce/kafka-client": "^0.2.29", "@restorecommerce/protos": "^0.5.0", - "@restorecommerce/resource-base-interface": "^0.2.3", + "@restorecommerce/resource-base-interface": "^0.2.5", "@restorecommerce/service-config": "^0.4.23", "lodash": "^4.17.21", "redis": "^4.0.3", @@ -1051,41 +1051,22 @@ "integrity": "sha512-hQf/m94vXfYlPJT4ml8GLtLKFSY0xFXWVVWfoWnPmWfuuT2+A3Enp/q7Je8gdsQSdTzQwSix7InclrE2o4ZNtw==" }, "node_modules/@restorecommerce/resource-base-interface": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@restorecommerce/resource-base-interface/-/resource-base-interface-0.2.3.tgz", - "integrity": "sha512-ZO9rpdvH5h6yXCMqOBO5Q3YB2XrWqUg9bM1kEl6dJXgq+bkmNGU03y4+O4BjwRNjKousY6sutAaflKnKw3wBCQ==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@restorecommerce/resource-base-interface/-/resource-base-interface-0.2.5.tgz", + "integrity": "sha512-C3JckNPr1om966aXoDG/JzQauoKs0ZVJ/KsKpSY59Xk8H6uspd7cpVklHyYwo+Qe3AiP7b4jAY/Kc+6jaHYaBg==", "dependencies": { "@restorecommerce/chassis-srv": "^0.3.6", "@restorecommerce/grpc-client": "^0.2.14", "@restorecommerce/kafka-client": "^0.2.29", "@restorecommerce/protos": "^0.5.0", "@restorecommerce/service-config": "^0.4.23", - "bluebird": "^3.7.2", "lodash": "^4.17.21", - "redis": "^3.1.2" + "redis": "^4.0.2" }, "engines": { "node": ">= 12.0.0" } }, - "node_modules/@restorecommerce/resource-base-interface/node_modules/redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", - "dependencies": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-redis" - } - }, "node_modules/@restorecommerce/service-config": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/@restorecommerce/service-config/-/service-config-0.4.23.tgz", @@ -1918,11 +1899,6 @@ "file-uri-to-path": "1.0.0" } }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, "node_modules/boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -11852,31 +11828,17 @@ "integrity": "sha512-hQf/m94vXfYlPJT4ml8GLtLKFSY0xFXWVVWfoWnPmWfuuT2+A3Enp/q7Je8gdsQSdTzQwSix7InclrE2o4ZNtw==" }, "@restorecommerce/resource-base-interface": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@restorecommerce/resource-base-interface/-/resource-base-interface-0.2.3.tgz", - "integrity": "sha512-ZO9rpdvH5h6yXCMqOBO5Q3YB2XrWqUg9bM1kEl6dJXgq+bkmNGU03y4+O4BjwRNjKousY6sutAaflKnKw3wBCQ==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@restorecommerce/resource-base-interface/-/resource-base-interface-0.2.5.tgz", + "integrity": "sha512-C3JckNPr1om966aXoDG/JzQauoKs0ZVJ/KsKpSY59Xk8H6uspd7cpVklHyYwo+Qe3AiP7b4jAY/Kc+6jaHYaBg==", "requires": { "@restorecommerce/chassis-srv": "^0.3.6", "@restorecommerce/grpc-client": "^0.2.14", "@restorecommerce/kafka-client": "^0.2.29", "@restorecommerce/protos": "^0.5.0", "@restorecommerce/service-config": "^0.4.23", - "bluebird": "^3.7.2", "lodash": "^4.17.21", - "redis": "^3.1.2" - }, - "dependencies": { - "redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", - "requires": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - } - } + "redis": "^4.0.2" } }, "@restorecommerce/service-config": { @@ -12516,11 +12478,6 @@ "file-uri-to-path": "1.0.0" } }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, "boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", diff --git a/package.json b/package.json index bee837d..443eae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@restorecommerce/resource-srv", - "version": "0.1.1", + "version": "0.1.2", "description": "Restore Commerce Resource Microservice", "main": "lib/start.js", "author": "n-fuse GmbH", @@ -22,7 +22,7 @@ "@restorecommerce/grpc-client": "^0.2.14", "@restorecommerce/kafka-client": "^0.2.29", "@restorecommerce/protos": "^0.5.0", - "@restorecommerce/resource-base-interface": "^0.2.3", + "@restorecommerce/resource-base-interface": "^0.2.5", "@restorecommerce/service-config": "^0.4.23", "lodash": "^4.17.21", "redis": "^4.0.3", diff --git a/src/worker.ts b/src/worker.ts index ea2e272..2f81920 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -109,11 +109,13 @@ export class Worker { await events.start(); this.offsetStore = new OffsetStore(events, cfg, logger); - let redisClient: any; + let redisClient: RedisClientType; if (cfg.get('redis')) { const redisConfig = cfg.get('redis'); redisConfig.db = cfg.get('redis:db-indexes:db-resourcesCounter'); redisClient = redis.createClient(redisConfig); + redisClient.on('error', (err) => logger.error('Redis Client Error', err)); + await redisClient.connect(); } const fieldGeneratorConfig: any = cfg.get('fieldHandlers:fieldGenerators'); const bufferHandlerConfig: any = cfg.get('fieldHandlers:bufferFields'); @@ -129,6 +131,8 @@ export class Worker { const redisConfig = cfg.get('redis'); redisConfig.db = cfg.get('redis:db-indexes:db-subject'); const redisClientSubject: RedisClientType = redis.createClient(redisConfig); + await redisClientSubject.on('error', (err) => logger.error('Redis Client Error', err)); + await redisClientSubject.connect(); for (let resourceType in resources) { const resourceCfg = resources[resourceType]; const resourcesServiceConfigPrefix = resourceCfg.resourcesServiceConfigPrefix;