From b9c20d01fbed74b754424ff52a9c8171167a2b9e Mon Sep 17 00:00:00 2001 From: Ricardo Garim Date: Tue, 10 Dec 2024 16:10:33 -0300 Subject: [PATCH] chore: move db calls to model definition --- apps/meteor/ee/server/startup/presence.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/meteor/ee/server/startup/presence.ts b/apps/meteor/ee/server/startup/presence.ts index 933399fc6cb6..daf0e4b6da48 100644 --- a/apps/meteor/ee/server/startup/presence.ts +++ b/apps/meteor/ee/server/startup/presence.ts @@ -1,14 +1,13 @@ import { Presence } from '@rocket.chat/core-services'; -import { id as instanceId } from '@rocket.chat/instance-status'; -import { InstanceStatus } from '@rocket.chat/models'; +import { InstanceStatus } from '@rocket.chat/instance-status'; +import { InstanceStatus as InstanceStatusModel } from '@rocket.chat/models'; import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; import { throttle } from 'underscore'; // update connections count every 30 seconds const updateConns = throttle(function _updateConns() { - const nodeId = instanceId(); - void InstanceStatus.updateConnections(nodeId, Meteor.server.sessions.size); + void InstanceStatusModel.updateConnections(InstanceStatus.id(), Meteor.server.sessions.size); }, 30000); Meteor.startup(() => {