Skip to content

Commit

Permalink
remove unused logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogarim committed Dec 9, 2024
1 parent c883c1a commit 3b606df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
22 changes: 4 additions & 18 deletions apps/meteor/ee/server/local-services/instance/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export class InstanceService extends ServiceClassInternal implements IInstanceSe
this.isTransporterTCP = typeof transporter !== 'string';

const activeInstances = InstanceStatusRaw.getActiveInstancesAddress()
.then((instances) => instances)
.then((instances) => {
console.info(`Found ${instances.length} active instances`);
return instances;
})
.catch(() => []);

this.transporter = this.isTransporterTCP
Expand All @@ -66,23 +69,6 @@ export class InstanceService extends ServiceClassInternal implements IInstanceSe
...getLogger(process.env),
});

if (this.isTransporterTCP) {
this.broker.localBus.on('$node.connected', (node) => {
console.log(`[${this.broker.nodeID}] connected to ${node.node.id}`);
});

this.broker.localBus.on('$node.disconnected', (node) => {
console.log(`[${this.broker.nodeID}] disconnected from ${node.node.id}`);
});

// setInterval(async () => {
// const nodes: Array<{ id: string }> = await this.broker.call('$node.list', { onlyAvailable: true });
// const localNode = this.broker.getLocalNodeInfo();
// console.log(nodes.map((node) => node.id));
// console.log(localNode.ipList[0], localNode.instanceID, localNode.port);
// }, 10000);
}

this.onEvent('license.module', async ({ module, valid }) => {
if (module === 'scalability' && valid) {
await this.startBroadcast();
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/server/models/raw/InstanceStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class InstanceStatusRaw extends BaseRaw<IInstanceStatus> implements IInst
}

async getActiveInstancesAddress(): Promise<string[]> {
const instances = await this.find({}, { projection: { _id: 1, extraInformation: { host: 1, port: 1 } } }).toArray();
return instances.map((instance) => `${instance.extraInformation.host}:${instance.extraInformation.port}/${instance._id}`);
const instances = await this.find({}, { projection: { _id: 1, extraInformation: { host: 1, tcpPort: 1 } } }).toArray();
return instances.map((instance) => `${instance.extraInformation.host}:${instance.extraInformation.tcpPort}/${instance._id}`);
}

async setDocumentHeartbeat(documentId: string): Promise<UpdateResult> {
Expand Down
2 changes: 0 additions & 2 deletions packages/instance-status/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ async function unregisterInstance() {
async function ping() {
const result = await InstanceStatusModel.setDocumentHeartbeat(ID);

console.log(`[${ID}] ping`, result.modifiedCount);

if (result.modifiedCount === 0) {
await registerInstance(currentInstance.name, currentInstance.extraInformation);
}
Expand Down

0 comments on commit 3b606df

Please sign in to comment.