File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
redisinsight/api/src/modules Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { IFindRedisClientInstanceByOptions } from 'src/modules/redis/redis.servi
3
3
import { isNull , flatten , uniqBy } from 'lodash' ;
4
4
import { RecommendationService } from 'src/modules/recommendation/recommendation.service' ;
5
5
import { catchAclError } from 'src/utils' ;
6
+ import { RECOMMENDATION_NAMES } from 'src/constants' ;
6
7
import { DatabaseAnalyzer } from 'src/modules/database-analysis/providers/database-analyzer' ;
7
8
import { plainToClass } from 'class-transformer' ;
8
9
import { DatabaseAnalysis , ShortDatabaseAnalysis } from 'src/modules/database-analysis/models' ;
@@ -58,11 +59,13 @@ export class DatabaseAnalysisService {
58
59
59
60
const recommendations = DatabaseAnalysisService . getRecommendationsSummary (
60
61
flatten ( await Promise . all (
61
- scanResults . map ( async ( nodeResult ) => (
62
+ scanResults . map ( async ( nodeResult , idx ) => (
62
63
await this . recommendationService . getRecommendations ( {
63
64
client : nodeResult . client ,
64
65
keys : nodeResult . keys ,
65
66
total : progress . total ,
67
+ // TODO: create generic solution to exclude recommendations
68
+ exclude : idx !== 0 ? [ RECOMMENDATION_NAMES . RTS ] : [ ] ,
66
69
} )
67
70
) ) ,
68
71
) ) ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
2
2
import { Redis } from 'ioredis' ;
3
3
import { RecommendationProvider } from 'src/modules/recommendation/providers/recommendation.provider' ;
4
4
import { Recommendation } from 'src/modules/database-analysis/models/recommendation' ;
5
+ import { RECOMMENDATION_NAMES } from 'src/constants' ;
5
6
import { RedisString } from 'src/common/constants' ;
6
7
import { Key } from 'src/modules/database-analysis/models' ;
7
8
@@ -10,6 +11,7 @@ interface RecommendationInput {
10
11
keys ?: Key [ ] ,
11
12
info ?: RedisString ,
12
13
total ?: number ,
14
+ exclude ?: string [ ] ,
13
15
}
14
16
15
17
@Injectable ( )
@@ -31,6 +33,7 @@ export class RecommendationService {
31
33
keys,
32
34
info,
33
35
total,
36
+ exclude,
34
37
} = dto ;
35
38
36
39
return (
@@ -49,7 +52,8 @@ export class RecommendationService {
49
52
await this . recommendationProvider . determineBigSetsRecommendation ( keys ) ,
50
53
await this . recommendationProvider . determineConnectionClientsRecommendation ( client ) ,
51
54
await this . recommendationProvider . determineSetPasswordRecommendation ( client ) ,
52
- await this . recommendationProvider . determineRTSRecommendation ( client , keys ) ,
55
+ // TODO rework, need better solution to do not start determine recommendation
56
+ exclude . includes ( RECOMMENDATION_NAMES . RTS ) ? null : await this . recommendationProvider . determineRTSRecommendation ( client , keys ) ,
53
57
] ) ) ;
54
58
}
55
59
}
You can’t perform that action at this time.
0 commit comments