diff --git a/services/spelling/app/coffee/HealthCheckController.coffee b/services/spelling/app/coffee/HealthCheckController.coffee index 80708cb6e3..c4f847f46d 100644 --- a/services/spelling/app/coffee/HealthCheckController.coffee +++ b/services/spelling/app/coffee/HealthCheckController.coffee @@ -12,8 +12,8 @@ module.exports = language: "en" timeout: 1000 * 20 request.post opts, (err, response, body)-> - console.log body?.misspellings[0]?.suggestions.length - numberOfSuggestions = body?.misspellings[0]?.suggestions?.length + console.log body?.misspellings?[0]?.suggestions.length + numberOfSuggestions = body?.misspellings?[0]?.suggestions?.length if numberOfSuggestions > 10 logger.log "health check passed" res.sendStatus 200 diff --git a/services/spelling/app/coffee/SpellingAPIController.coffee b/services/spelling/app/coffee/SpellingAPIController.coffee index 67a095d12d..9401d0b36d 100644 --- a/services/spelling/app/coffee/SpellingAPIController.coffee +++ b/services/spelling/app/coffee/SpellingAPIController.coffee @@ -10,7 +10,8 @@ module.exports = SpellingAPIController = if error? logger.err err:error, user_id:req?.params?.user_id, word_count: req?.body?.words?.length, "error processing spelling request" return res.sendStatus(500) - res.send(result) + # res.send(result) + res.writeHead 200 learn: (req, res, next) -> metrics.inc "spelling-learn", 0.1