Skip to content

Commit 5f4ffd3

Browse files
author
KIvanow
committed
RI-7091 - extra logs and removed extra code
1 parent 77057c4 commit 5f4ffd3

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

redisinsight/api/src/modules/database-discovery/auto.database-discovery.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class AutoDatabaseDiscoveryService {
2727
* Database alias will be "host:port"
2828
*/
2929
async discover(sessionMetadata: SessionMetadata) {
30+
console.log('AutoDatabaseDiscoveryService discover called', this.isDiscoveryRunning);
3031
// Return immediately to not block the main thread
3132
if (this.isDiscoveryRunning) {
3233
return;

redisinsight/api/src/modules/database-discovery/local.database-discovery.service.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const SERVER_CONFIG = config.get('server') as Config['server'];
1111
@Injectable()
1212
export class LocalDatabaseDiscoveryService extends DatabaseDiscoveryService {
1313
private logger = new Logger('LocalDatabaseDiscoveryService');
14-
private isDiscoveryRunning = false;
1514

1615
constructor(
1716
@Inject(forwardRef(() => SettingsService))
@@ -30,25 +29,17 @@ export class LocalDatabaseDiscoveryService extends DatabaseDiscoveryService {
3029
sessionMetadata: SessionMetadata,
3130
firstRun?: boolean,
3231
): Promise<void> {
33-
// Return immediately if discovery is already in progress
34-
if (this.isDiscoveryRunning) {
35-
return;
36-
}
37-
3832
// No need to auto discover for Redis Stack - quick check
3933
if (SERVER_CONFIG.buildType === 'REDIS_STACK') {
4034
return;
4135
}
4236

43-
// Mark as running and perform discovery in background
44-
this.isDiscoveryRunning = true;
4537
try {
4638
// check agreements to understand if it is first launch
4739
const settings =
4840
await this.settingsService.getAppSettings(sessionMetadata);
4941

5042
if (!settings?.agreements?.eula) {
51-
this.isDiscoveryRunning = false;
5243
return;
5344
}
5445

@@ -61,8 +52,6 @@ export class LocalDatabaseDiscoveryService extends DatabaseDiscoveryService {
6152
} catch (e) {
6253
// ignore error
6354
this.logger.error('Unable to discover databases', e);
64-
} finally {
65-
this.isDiscoveryRunning = false;
6655
}
6756
}
6857
}

0 commit comments

Comments
 (0)