@imqueue/core 2.0.13 → 2.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imqueue/core",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Simple JSON-based messaging queue for inter service communication",
5
5
  "keywords": [
6
6
  "message-queue",
package/src/RedisQueue.js CHANGED
@@ -816,7 +816,7 @@ class RedisQueue extends events_1.EventEmitter {
816
816
  }
817
817
  const filter = new RegExp(this.options.prefix + ':' +
818
818
  (this.options.cleanupFilter || '*').replace(/\*/g, '.*'), 'i');
819
- const clients = await this.writer.client('LIST');
819
+ const clients = await this.writer.client('LIST') || '';
820
820
  const connectedKeys = (clients.match(RX_CLIENT_NAME) || [])
821
821
  .filter((name) => RX_CLIENT_TEST.test(name) && filter.test(name))
822
822
  .map((name) => name
@@ -863,6 +863,7 @@ class RedisQueue extends events_1.EventEmitter {
863
863
  }
864
864
  catch (err) {
865
865
  // istanbul ignore next
866
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
866
867
  if (err.message.match(/Stream connection ended/)) {
867
868
  break;
868
869
  }
@@ -893,24 +894,28 @@ class RedisQueue extends events_1.EventEmitter {
893
894
  }
894
895
  try {
895
896
  await this.reader.brpoplpush(this.key, workerKey, 0);
897
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
896
898
  }
897
- catch (err) {
899
+ catch (_) {
898
900
  // istanbul ignore next
899
901
  break;
900
902
  }
901
903
  const msgArr = await this.writer.lrange(workerKey, -1, 1);
902
- if (msgArr.length !== 1) {
904
+ if (!msgArr || (msgArr === null || msgArr === void 0 ? void 0 : msgArr.length) !== 1) {
903
905
  // noinspection ExceptionCaughtLocallyJS
904
906
  throw new Error('Wrong messages count');
905
907
  }
906
- const msg = msgArr[0];
908
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
909
+ const [msg] = msgArr;
907
910
  this.process([key, msg]);
908
- this.writer.del(workerKey);
911
+ this.writer.del(workerKey).catch(e => this.logger.warn('OnReadSafe: del error', e));
909
912
  }
910
913
  }
911
914
  catch (err) {
912
915
  // istanbul ignore next
913
- this.emitError('OnReadSafe', 'safe reader failed', err);
916
+ this.emitError('OnReadSafe', 'safe reader failed',
917
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
918
+ err);
914
919
  }
915
920
  }
916
921
  /**
@@ -927,6 +932,7 @@ class RedisQueue extends events_1.EventEmitter {
927
932
  const readMethod = this.options.safeDelivery
928
933
  ? 'readSafe'
929
934
  : 'readUnsafe';
935
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
930
936
  process.nextTick(this[readMethod].bind(this));
931
937
  return this;
932
938
  }
package/debug.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/debug_getter.d.ts DELETED
@@ -1,9 +0,0 @@
1
- declare class DebugGetter {
2
- name: string;
3
- static propertiesMap: Record<string, string>;
4
- private get property();
5
- private set property(value);
6
- constructor(name: string);
7
- addProperty(value: string): void;
8
- removeProperty(): void;
9
- }
@@ -1 +0,0 @@
1
- export {};