Scheduling fixes

This commit is contained in:
Michael Schmatz 2014-03-02 18:55:07 -08:00
parent 94b98a2d46
commit 81466675ec

View file

@ -108,6 +108,15 @@ module.exports.processTaskResult = (req, res) ->
console.log "Deleted message." console.log "Deleted message."
if err? then return errors.badInput res, "The queue message is already back in the queue, rejecting results." 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) -> logTaskComputation clientResponseObject, taskLog, (logErr) ->
if logErr? then return errors.serverError res, "There as a problem logging the task computation: #{logErr}" if logErr? then return errors.serverError res, "There as a problem logging the task computation: #{logErr}"