mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Added a projection to Clans getMemberSessions to help with the gargantuan fetch running us out of memory.
This commit is contained in:
parent
7aff510f3e
commit
4de9071f1a
3 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,6 @@ $gameControlMargin: 30px
|
|||
@include box-shadow(0px 0px 35px skyblue)
|
||||
|
||||
.level-difficulty-banner-text
|
||||
position: absolute
|
||||
position: absolute
|
||||
bottom: 170%
|
||||
pointer-events: none
|
||||
|
|
|
@ -35,6 +35,7 @@ module.exports = class ClanDetailsView extends RootView
|
|||
@clan = new Clan _id: @clanID
|
||||
@members = new CocoCollection([], { url: "/db/clan/#{@clanID}/members", model: User, comparator:'slug' })
|
||||
@memberAchievements = new CocoCollection([], { url: "/db/clan/#{@clanID}/member_achievements", model: EarnedAchievement, comparator:'_id' })
|
||||
# MemberSessions: only loads creatorName, levelName, codeLanguage, submittedCodeLanguage for each session
|
||||
@memberSessions = new CocoCollection([], { url: "/db/clan/#{@clanID}/member_sessions", model: LevelSession, comparator:'_id' })
|
||||
|
||||
@listenTo me, 'sync', => @render?()
|
||||
|
|
|
@ -116,7 +116,7 @@ ClanHandler = class ClanHandler extends Handler
|
|||
return @sendDatabaseError(res, err) if err
|
||||
return @sendDatabaseError(res, err) unless clan
|
||||
memberIDs = _.map clan.get('members') ? [], (memberID) -> memberID.toHexString()
|
||||
LevelSession.find {creator: {$in: memberIDs}}, (err, documents) =>
|
||||
LevelSession.find {creator: {$in: memberIDs}}, 'creatorName levelName codeLanguage submittedCodeLanguage', (err, documents) =>
|
||||
return @sendDatabaseError(res, err) if err?
|
||||
cleandocs = (LevelSessionHandler.formatEntity(req, doc) for doc in documents)
|
||||
@sendSuccess(res, cleandocs)
|
||||
|
|
Loading…
Reference in a new issue