try and fix high cpu usage

main v1.4.6
Ayush Mukherjee 4 years ago
parent 1ffed1c220
commit 7f6460ade3

@ -92,13 +92,13 @@ const streamFns = {
return await streams.find().populate('event').populate({ return await streams.find().populate('event').populate({
path: 'matches', path: 'matches',
populate: [{ path: 'orange' }, { path: 'blue' }], populate: [{ path: 'orange' }, { path: 'blue' }],
}).populate('casters').populate('hosts').exec() }).populate('casters').populate('hosts').lean().exec()
}, },
getById: async (id) => { getById: async (id) => {
return await streams.findById(id).populate('event').populate({ return await streams.findById(id).populate('event').populate({
path: 'matches', path: 'matches',
populate: [{ path: 'orange' }, { path: 'blue' }], populate: [{ path: 'orange' }, { path: 'blue' }],
}).populate('casters').populate('hosts').exec() }).populate('casters').populate('hosts').lean().exec()
}, },
update: async(id, data) => { update: async(id, data) => {
return await streams.findByIdAndUpdate(id, data).exec() return await streams.findByIdAndUpdate(id, data).exec()

Loading…
Cancel
Save