From 7e4b42e9b3482460cac77a603809a8b5d4016477 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 29 Nov 2017 11:23:49 +0200 Subject: Fix: Frequent Subscriptions problem that make Excessive CPU usage. Thanks to mfshiu ! Closes #1096, Closes wekan/wekan-mongodb#2 --- client/components/boards/boardsList.js | 7 +++++++ client/components/main/layouts.js | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'client/components') diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 4ec4b534..6c9600a1 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -1,6 +1,13 @@ const subManager = new SubsManager(); BlazeComponent.extendComponent({ + onCreated() { + // Here is the only place that boards data needed, all boards data will stop sync when leaving this template. + Meteor.subscribe('boards'); + Meteor.subscribe('setting'); + Meteor.subscribe('user-admin'); + }, + boards() { return Boards.find({ archived: false, diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index 1936d7aa..04a22624 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -1,7 +1,3 @@ -Meteor.subscribe('boards'); -Meteor.subscribe('setting'); -Meteor.subscribe('user-admin'); - BlazeLayout.setRoot('body'); const i18nTagToT9n = (i18nTag) => { -- cgit v1.2.3-1-g7c22