@autofleet/matmon 2.3.1-beta-1 → 2.3.1-beta-4

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.
@@ -101,8 +101,11 @@ class RedisCache {
101
101
  logger_1.default.error('keyValues must be an object', { error });
102
102
  throw error;
103
103
  }
104
+ if (keyValues === null || keyValues === undefined || Object.keys(keyValues).length === 0) {
105
+ return;
106
+ }
104
107
  const keyValuesWithPrefix = Object.entries(keyValues).map(([key, value]) => [KEY_PREFIX + key, JSON.stringify(value)]);
105
- const ttl = parseInt(String(this.baseTTL * (Math.random() + 1)), 10);
108
+ const ttl = Math.trunc(this.baseTTL * (Math.random() + 1));
106
109
  try {
107
110
  const multi = this.client.multi();
108
111
  const setPromise = multi.msetAsync(...keyValuesWithPrefix.flat());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/matmon",
3
- "version": "2.3.1-beta-1",
3
+ "version": "2.3.1-beta-4",
4
4
  "description": "manage cache",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",