Skip to content

Commit 77f72f0

Browse files
author
arthosofteq
authored
Merge pull request #1257 from RedisInsight/be/feature/RI-3139_speed_up_keys_list
return null instead of undefined
2 parents eb53c87 + 46d960c commit 77f72f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

redisinsight/api/src/modules/browser/services/keys-business/scanner/strategies/abstract.strategy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export abstract class AbstractStrategy implements IScannerStrategy {
6969
new Command(BrowserToolKeysCommands.Ttl, [key], { replyEncoding: 'utf8' }),
7070
) as number;
7171
} catch (e) {
72-
// ignore error
72+
ttl = null;
7373
}
7474

7575
try {
@@ -79,15 +79,15 @@ export abstract class AbstractStrategy implements IScannerStrategy {
7979
),
8080
) as number;
8181
} catch (e) {
82-
// ignore error
82+
size = null;
8383
}
8484

8585
try {
8686
type = filterType || await client.sendCommand(
8787
new Command(BrowserToolKeysCommands.Type, [key], { replyEncoding: 'utf8' }),
8888
) as string;
8989
} catch (e) {
90-
// ignore error
90+
type = null;
9191
}
9292

9393
return {
@@ -128,7 +128,7 @@ export abstract class AbstractStrategy implements IScannerStrategy {
128128
if (transactionError) {
129129
throw transactionError;
130130
} else {
131-
return transactionResults.map((item: [ReplyError, any]) => item[1]);
131+
return transactionResults.map((item: [ReplyError, any]) => item[0] ? null : item[1]);
132132
}
133133
}
134134

@@ -146,7 +146,7 @@ export abstract class AbstractStrategy implements IScannerStrategy {
146146
if (transactionError) {
147147
throw transactionError;
148148
} else {
149-
return transactionResults.map((item: [ReplyError, any]) => item[1]);
149+
return transactionResults.map((item: [ReplyError, any]) => item[0] ? null : item[1]);
150150
}
151151
}
152152

@@ -171,7 +171,7 @@ export abstract class AbstractStrategy implements IScannerStrategy {
171171
if (transactionError) {
172172
throw transactionError;
173173
} else {
174-
return transactionResults.map((item: [ReplyError, any]) => item[1]);
174+
return transactionResults.map((item: [ReplyError, any]) => item[0] ? null : item[1]);
175175
}
176176
}
177177
}

0 commit comments

Comments
 (0)