mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Move every Users.findOne() to the ReactiveCache
This commit is contained in:
parent
bf48d4371c
commit
6e1ef3d94a
35 changed files with 175 additions and 125 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
//var nodemailer = require('nodemailer');
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ Meteor.startup(() => {
|
|||
// so we pass userId with closure
|
||||
const userId = user._id;
|
||||
Meteor.setTimeout(() => {
|
||||
const user = Users.findOne(userId);
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
|
||||
// for each user, in the timed period, only the first call will get the cached content,
|
||||
// other calls will get nothing
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Notifications = {
|
|||
getUsers: watchers => {
|
||||
const users = [];
|
||||
watchers.forEach(userId => {
|
||||
const user = Users.findOne(userId);
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
if (user) users.push(user);
|
||||
});
|
||||
return users;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ if (Meteor.isServer) {
|
|||
});
|
||||
|
||||
const userId = params.userId ? params.userId : integrations[0].userId;
|
||||
const user = Users.findOne(userId);
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
const text = `${params.user} ${TAPi18n.__(
|
||||
description,
|
||||
quoteParams,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue