mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Trying to shut the server up about some anonymous user who is simulating.
This commit is contained in:
parent
ca6c95b0f7
commit
ffcfec0a6a
1 changed files with 3 additions and 2 deletions
|
@ -225,7 +225,7 @@ module.exports.recordTwoGames = (req, res) ->
|
|||
updateSessions.bind(yetiGuru)
|
||||
indexNewScoreArray.bind(yetiGuru)
|
||||
addMatchToSessions.bind(yetiGuru)
|
||||
updateUserSimulationCounts.bind(yetiGuru, req.user._id)
|
||||
updateUserSimulationCounts.bind(yetiGuru, req.user?._id)
|
||||
], (err, successMessageObject) ->
|
||||
if err? then return errors.serverError res, "There was an error recording the single game:#{err}"
|
||||
sendResponseObject req, res, {'message': 'The single game was submitted successfully!'}
|
||||
|
@ -450,7 +450,7 @@ module.exports.processTaskResult = (req, res) ->
|
|||
updateSessions.bind(yetiGuru)
|
||||
indexNewScoreArray.bind(yetiGuru)
|
||||
addMatchToSessions.bind(yetiGuru)
|
||||
updateUserSimulationCounts.bind(yetiGuru, req.user._id)
|
||||
updateUserSimulationCounts.bind(yetiGuru, req.user?._id)
|
||||
determineIfSessionShouldContinueAndUpdateLog.bind(yetiGuru)
|
||||
findNearestBetterSessionID.bind(yetiGuru)
|
||||
addNewSessionsToQueue.bind(yetiGuru)
|
||||
|
@ -615,6 +615,7 @@ updateUserSimulationCounts = (reqUserID, callback) ->
|
|||
callback null
|
||||
|
||||
incrementUserSimulationCount = (userID, type, callback) =>
|
||||
return callback null unless userID
|
||||
inc = {}
|
||||
inc[type] = 1
|
||||
User.update {_id: userID}, {$inc: inc}, (err, affected) ->
|
||||
|
|
Loading…
Reference in a new issue