diff --git a/dist/class/stream/Stream.class.d.ts b/dist/class/stream/Stream.class.d.ts index 5ba8858..22d4ab5 100644 --- a/dist/class/stream/Stream.class.d.ts +++ b/dist/class/stream/Stream.class.d.ts @@ -72,7 +72,7 @@ export declare class Stream extends EventEmitter { * * @description Push a new entry on the stream, if no ID provided, use the special ID "*". * Using the special ID "*", Redis generate IDs as follow 1526985685298-0, the first part - * being a timestamp, and the second an incremente. + * being a timestamp, and the second an increment. * @param {data: { key: string; value: string | Buffer | number }, options: { id?: string; metadata?: string }} [options] * @returns {Promise} * @example diff --git a/dist/class/stream/Stream.class.js b/dist/class/stream/Stream.class.js index 5c5562c..4580543 100644 --- a/dist/class/stream/Stream.class.js +++ b/dist/class/stream/Stream.class.js @@ -95,7 +95,7 @@ class Stream extends node_events_1.EventEmitter { * * @description Push a new entry on the stream, if no ID provided, use the special ID "*". * Using the special ID "*", Redis generate IDs as follow 1526985685298-0, the first part - * being a timestamp, and the second an incremente. + * being a timestamp, and the second an increment. * @param {data: { key: string; value: string | Buffer | number }, options: { id?: string; metadata?: string }} [options] * @returns {Promise} * @example diff --git a/dist/index.js b/dist/index.js index c58ffb0..e1e9c5a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -159,7 +159,7 @@ async function clearAllKeys(instance = "publisher", redis) { } exports.clearAllKeys = clearAllKeys; async function closeConnection(instance = "publisher", redis, forceExit = false) { - const { isAlive } = await getConnectionPerf(instance); + const { isAlive } = await getConnectionPerf(instance, redis); if (!isAlive) { return; } diff --git a/dist/index.js.map b/dist/index.js.map index d306908..faa5697 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,6CAAmC;AACnC,qDAA8C;AAE9C,kCAAkC;AAClC,sDAA8C;AAC9C,mCAAgC;AAAvB,gGAAA,KAAK,OAAA;AAEd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AAqB,WAAW,EAAE,KAAa;IAChF,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IAEpH,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,MAAM,aAAa,CAAC,OAAO,EAAE,CAAC;AAChC,CAAC;AARD,oCAQC;AAED,KAAK,UAAU,eAAe,CAAC,WAAqB,WAAW,EAAE,KAAY,EAAE,YAAqB,KAAK;IACvG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAE7D,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IAED,YAAY,CAAC,GAAG,EAAE,CAAC,SAAS,CAAE,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnE,MAAM,IAAA,kBAAI,EAAC,KAAM,EAAE,KAAK,CAAC,CAAC;IAE1B,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,uDAAqC;AACrC,+DAA6C;AAC7C,uDAAqC;AACrC,4DAA0C;AAC1C,6DAA2C;AAC3C,6DAA2C;AAC3C,uDAAuC"} \ No newline at end of file diff --git a/src/class/stream/Stream.class.ts b/src/class/stream/Stream.class.ts index eda1bfb..48d9fbd 100644 --- a/src/class/stream/Stream.class.ts +++ b/src/class/stream/Stream.class.ts @@ -155,7 +155,7 @@ export class Stream extends EventEmitter { * * @description Push a new entry on the stream, if no ID provided, use the special ID "*". * Using the special ID "*", Redis generate IDs as follow 1526985685298-0, the first part - * being a timestamp, and the second an incremente. + * being a timestamp, and the second an increment. * @param {data: { key: string; value: string | Buffer | number }, options: { id?: string; metadata?: string }} [options] * @returns {Promise} * @example diff --git a/src/index.ts b/src/index.ts index 816e9f2..6740d9c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -166,7 +166,7 @@ export async function clearAllKeys(instance: Instance = "publisher", redis?: Red } async function closeConnection(instance: Instance = "publisher", redis: Redis, forceExit: boolean = false) { - const { isAlive } = await getConnectionPerf(instance); + const { isAlive } = await getConnectionPerf(instance, redis); if (!isAlive) { return;