mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Scheduling fixes
This commit is contained in:
parent
94b98a2d46
commit
81466675ec
1 changed files with 43 additions and 34 deletions
|
@ -108,6 +108,15 @@ module.exports.processTaskResult = (req, res) ->
|
|||
console.log "Deleted message."
|
||||
if err? then return errors.badInput res, "The queue message is already back in the queue, rejecting results."
|
||||
|
||||
LevelSession.findOne(_id: clientResponseObject.originalSessionID).lean().exec (err, levelSession) ->
|
||||
if err? then return errors.serverError res, "There was a problem finding the level session:#{err}"
|
||||
|
||||
console.log "Queue message created at: #{taskLogJSON.createdAt}, level session submitted at #{levelSession.submitDate}"
|
||||
|
||||
if taskLogJSON.createdAt <= levelSession.submitDate
|
||||
console.log "Task has been resubmitted!"
|
||||
return sendResponseObject req, res, {"message":"The game has been resubmitted. Removing from queue..."}
|
||||
|
||||
logTaskComputation clientResponseObject, taskLog, (logErr) ->
|
||||
if logErr? then return errors.serverError res, "There as a problem logging the task computation: #{logErr}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue