Skip to content

Commit

Permalink
Fix typescript issue in RedisAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Nov 30, 2023
1 parent 0cbd9e6 commit 1ce4acb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/storages/inRedis/RedisAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export class RedisAdapter extends ioredis {
const wrapCommand = (originalMethod: Function, methodName: string) => {
// The value of "this" in this function should be the instance actually executing the method. It might be the instance referred (the base one)
// or it can be the instance of a Pipeline object.
return function () {
return function (this: RedisAdapter | Pipeline) {
const params = arguments;
const caller: (Pipeline | RedisAdapter) = this; // Need to change this crap to have TypeScript stop complaining
const caller: (Pipeline | RedisAdapter) = this;

const commandWrapper = () => {
instance.log.debug(`${LOG_PREFIX}Executing ${methodName}.`);
Expand Down
2 changes: 1 addition & 1 deletion src/storages/inRedis/SplitsCacheInRedis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { RedisAdapter } from './RedisAdapter';
/**
* Discard errors for an answer of multiple operations.
*/
function processPipelineAnswer(results: Array<[Error | null, string]>): (string | string[])[] {
function processPipelineAnswer(results: Array<[Error | null, string]>): string[] {
return results.reduce((accum: string[], errValuePair: [Error | null, string]) => {
if (errValuePair[0] === null) accum.push(errValuePair[1]);
return accum;
Expand Down

0 comments on commit 1ce4acb

Please sign in to comment.