move scoring to its own class (attempt to remove model from hanging

around in closure on server, which is what's causing our memory leak -
see http://goo.gl/7Gt0M)
This commit is contained in:
Tyler Renelle
2013-02-26 16:51:00 -05:00
parent 63392d644f
commit 9b20d8ceba
4 changed files with 260 additions and 263 deletions
+2 -2
View File
@@ -48,8 +48,8 @@ router.post '/users/:uid/tasks/:taskId/:direction', (req, res) ->
down: true
notes: "This task was created by a third-party service. Feel free to edit, it won't harm the connection to that service. Additionally, multiple services may piggy-back off this task."
scoring.setModel(model)
delta = scoring.score(taskId, direction)
score = scoring.Scoring(model)
delta = score.score(taskId, direction)
result = model.get ('_user.stats')
result.delta = delta
res.send(result)