mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Worked around mongoose toObject
Also tried elementary memory leak fix
This commit is contained in:
parent
4001d1c7fe
commit
ca7376b794
2 changed files with 5 additions and 1 deletions
|
@ -146,7 +146,7 @@ module.exports = class HomeView extends View
|
|||
status: "incomplete"
|
||||
god.spells = @filterProgrammableComponents level.attributes.thangs, @generateSpellToSourceMap data.sessions
|
||||
god.createWorld()
|
||||
|
||||
@god = god
|
||||
Backbone.Mediator.subscribe 'god:new-world-created', @onWorldCreated, @
|
||||
|
||||
onWorldCreated: (data) ->
|
||||
|
@ -154,6 +154,8 @@ module.exports = class HomeView extends View
|
|||
taskResults = @translateGoalStatesIntoTaskResults data.goalStates
|
||||
console.log "Task Results"
|
||||
console.log taskResults
|
||||
@god?.destroy()
|
||||
|
||||
$.ajax
|
||||
url: "/queue/scoring"
|
||||
data: taskResults
|
||||
|
|
|
@ -227,6 +227,7 @@ updateScoreInSession = (scoreObject,callback) ->
|
|||
|
||||
LevelSession.findOne sessionObjectQuery, (err, session) ->
|
||||
return callback err, null if err?
|
||||
session = session.toObject()
|
||||
updateObject =
|
||||
meanStrength: scoreObject.meanStrength
|
||||
standardDeviation: scoreObject.standardDeviation
|
||||
|
@ -250,6 +251,7 @@ retrieveOldScoreMetrics = (sessionID, callback) ->
|
|||
LevelSession.findOne sessionQuery, (err, session) ->
|
||||
return callback err, {"error":"There was an error retrieving the session."} if err?
|
||||
|
||||
session = session.toObject()
|
||||
defaultScore = (25 - 1.8*(25/3))
|
||||
defaultStandardDeviation = 25/3
|
||||
|
||||
|
|
Loading…
Reference in a new issue