mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-04 01:43:40 -04: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)
|
updateSessions.bind(yetiGuru)
|
||||||
indexNewScoreArray.bind(yetiGuru)
|
indexNewScoreArray.bind(yetiGuru)
|
||||||
addMatchToSessions.bind(yetiGuru)
|
addMatchToSessions.bind(yetiGuru)
|
||||||
updateUserSimulationCounts.bind(yetiGuru, req.user._id)
|
updateUserSimulationCounts.bind(yetiGuru, req.user?._id)
|
||||||
], (err, successMessageObject) ->
|
], (err, successMessageObject) ->
|
||||||
if err? then return errors.serverError res, "There was an error recording the single game:#{err}"
|
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!'}
|
sendResponseObject req, res, {'message': 'The single game was submitted successfully!'}
|
||||||
|
@ -450,7 +450,7 @@ module.exports.processTaskResult = (req, res) ->
|
||||||
updateSessions.bind(yetiGuru)
|
updateSessions.bind(yetiGuru)
|
||||||
indexNewScoreArray.bind(yetiGuru)
|
indexNewScoreArray.bind(yetiGuru)
|
||||||
addMatchToSessions.bind(yetiGuru)
|
addMatchToSessions.bind(yetiGuru)
|
||||||
updateUserSimulationCounts.bind(yetiGuru, req.user._id)
|
updateUserSimulationCounts.bind(yetiGuru, req.user?._id)
|
||||||
determineIfSessionShouldContinueAndUpdateLog.bind(yetiGuru)
|
determineIfSessionShouldContinueAndUpdateLog.bind(yetiGuru)
|
||||||
findNearestBetterSessionID.bind(yetiGuru)
|
findNearestBetterSessionID.bind(yetiGuru)
|
||||||
addNewSessionsToQueue.bind(yetiGuru)
|
addNewSessionsToQueue.bind(yetiGuru)
|
||||||
|
@ -615,6 +615,7 @@ updateUserSimulationCounts = (reqUserID, callback) ->
|
||||||
callback null
|
callback null
|
||||||
|
|
||||||
incrementUserSimulationCount = (userID, type, callback) =>
|
incrementUserSimulationCount = (userID, type, callback) =>
|
||||||
|
return callback null unless userID
|
||||||
inc = {}
|
inc = {}
|
||||||
inc[type] = 1
|
inc[type] = 1
|
||||||
User.update {_id: userID}, {$inc: inc}, (err, affected) ->
|
User.update {_id: userID}, {$inc: inc}, (err, affected) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue