diff --git a/packages/backend/src/nest/connections-manager/connections-manager.service.ts b/packages/backend/src/nest/connections-manager/connections-manager.service.ts index 608a31a149..a5983684e6 100644 --- a/packages/backend/src/nest/connections-manager/connections-manager.service.ts +++ b/packages/backend/src/nest/connections-manager/connections-manager.service.ts @@ -157,10 +157,10 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI this.logger('launchCommunityFromStorage') const community: InitCommunityPayload = await this.localDbService.get(LocalDBKeys.COMMUNITY) - console.log('launchCommunityFromStorage - community peers', community?.peers) + this.logger('launchCommunityFromStorage - community peers', community?.peers) if (community) { const sortedPeers = await this.localDbService.getSortedPeers(community.peers) - console.log('launchCommunityFromStorage - sorted peers', sortedPeers) + this.logger('launchCommunityFromStorage - sorted peers', sortedPeers) if (sortedPeers.length > 0) { community.peers = sortedPeers } @@ -589,7 +589,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_FETCH_ALL_DIRECT_MESSAGES, payload) }) this.storageService.on(StorageEvents.UPDATE_PEERS_LIST, (payload: StorePeerListPayload) => { - // this.libp2pService.emit(Libp2pEvents.UPDATE_KNOWN_PEERS_LIST, payload.peerList) this.serverIoProvider.io.emit(SocketActionTypes.PEER_LIST, payload) }) this.storageService.on(StorageEvents.SEND_PUSH_NOTIFICATION, (payload: PushNotificationPayload) => { @@ -605,9 +604,8 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI this.storageService.on( StorageEvents.REPLICATED_CSR, async (payload: { csrs: string[]; certificates: string[]; id: string }) => { - console.log(`On ${StorageEvents.REPLICATED_CSR}`) + this.logger(`Storage - ${StorageEvents.REPLICATED_CSR}`) this.libp2pService.emit(Libp2pEvents.DIAL_PEERS, await getLibp2pAddressesFromCsrs(payload.csrs)) - console.log(`Storage - ${StorageEvents.REPLICATED_CSR}`) this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CSRS, { csrs: payload.csrs }) this.registrationService.emit(RegistrationEvents.REGISTER_USER_CERTIFICATE, payload) } diff --git a/packages/backend/src/nest/libp2p/libp2p.types.ts b/packages/backend/src/nest/libp2p/libp2p.types.ts index 166be7ad94..1f9d8c9fb7 100644 --- a/packages/backend/src/nest/libp2p/libp2p.types.ts +++ b/packages/backend/src/nest/libp2p/libp2p.types.ts @@ -6,7 +6,6 @@ export enum Libp2pEvents { PEER_DISCONNECTED = 'peerDisconnected', NETWORK_STATS = 'networkStats', DIAL_PEERS = 'dialPeers', - // UPDATE_KNOWN_PEERS_LIST = 'updateKnownPeersList', } export interface Libp2pNodeParams { diff --git a/packages/backend/src/nest/libp2p/process-in-chunks.service.ts b/packages/backend/src/nest/libp2p/process-in-chunks.service.ts index bf05640c90..2e7b30588b 100644 --- a/packages/backend/src/nest/libp2p/process-in-chunks.service.ts +++ b/packages/backend/src/nest/libp2p/process-in-chunks.service.ts @@ -17,7 +17,6 @@ export class ProcessInChunksService extends EventEmitter { this.data = data this.processItem = processItem this.chunkSize = chunkSize - // this.isActive = true } updateData(items: T[]) { @@ -26,7 +25,6 @@ export class ProcessInChunksService extends EventEmitter { } public async processOneItem() { - // if (!this.isActive) return const toProcess = this.data.shift() if (toProcess) { try { @@ -42,7 +40,6 @@ export class ProcessInChunksService extends EventEmitter { } public async process() { - // this.isActive = true this.logger(`Processing ${this.data.length} items`) for (let i = 0; i < this.chunkSize; i++) { // Do not wait for this promise as items should be processed simultineously diff --git a/packages/backend/src/nest/local-db/local-db.service.ts b/packages/backend/src/nest/local-db/local-db.service.ts index fcbecc41c3..f5275ff77f 100644 --- a/packages/backend/src/nest/local-db/local-db.service.ts +++ b/packages/backend/src/nest/local-db/local-db.service.ts @@ -72,7 +72,6 @@ export class LocalDbService { } public async getSortedPeers(peers: string[] = []): Promise { - console.log('getSortedPeers peers got', peers) const peersStats = (await this.get(LocalDBKeys.PEERS)) || {} const stats: NetworkStats[] = Object.values(peersStats) return filterAndSortPeers(peers, stats) diff --git a/packages/backend/src/nest/storage/storage.service.ts b/packages/backend/src/nest/storage/storage.service.ts index 8e90309128..ae3e39acb0 100644 --- a/packages/backend/src/nest/storage/storage.service.ts +++ b/packages/backend/src/nest/storage/storage.service.ts @@ -337,12 +337,8 @@ export class StorageService extends EventEmitter { const allUsers = this.getAllUsers() const registeredUsers = this.getAllRegisteredUsers() const peers = [...new Set(await getUsersAddresses(allUsers.concat(registeredUsers)))] - console.log('updatePeersList, peers count:', peers.length) - console.log('STORATE peers', peers) - const community: InitCommunityPayload = await this.localDbService.get(LocalDBKeys.COMMUNITY) const sortedPeers = await this.localDbService.getSortedPeers(peers) - console.log('STORAGE sortedPeers', sortedPeers) if (sortedPeers.length > 0) { community.peers = sortedPeers await this.localDbService.put(LocalDBKeys.COMMUNITY, community)