From c40fd8b5188f89cdc82bd95c147daa1174a2672e Mon Sep 17 00:00:00 2001 From: Amoki Date: Mon, 8 Dec 2014 17:52:27 +0100 Subject: [PATCH] stop logging all documents and stop initializing opbeat --- lib/handlers/hydrater.js | 3 ++- lib/helpers/child-process.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/handlers/hydrater.js b/lib/handlers/hydrater.js index 60b0180..9ff102d 100644 --- a/lib/handlers/hydrater.js +++ b/lib/handlers/hydrater.js @@ -47,7 +47,8 @@ module.exports = function(req, res, server, next) { log.warn(err, "Error while queuing " + (task.file_path) ? task.file_path : task.document.id); } else { - log.info(task, "Queuing task"); + var loggingTask = {file_path: task.file_path, callback: task.callback, document: {id: task.document.id, identifier: task.document.identifier}}; + log.info(loggingTask, "Queuing task"); } }); diff --git a/lib/helpers/child-process.js b/lib/helpers/child-process.js index b9edd90..a074cfd 100644 --- a/lib/helpers/child-process.js +++ b/lib/helpers/child-process.js @@ -20,6 +20,7 @@ var logError = require('../utils').logError; var filePath; var path; +var opbeatInitialized = false; process.on('message', function(task) { filePath = task.file_path; @@ -29,9 +30,10 @@ process.on('message', function(task) { logError.config = task.opbeatConfig; /* istanbul ignore next */ - if(task.opbeatConfig && task.opbeatConfig.secretToken) { + if(!opbeatInitialized && task.opbeatConfig && task.opbeatConfig.secretToken) { var opbeat = require('opbeat'); logError.opbeat = opbeat(task.opbeatConfig); + opbeatInitialized = true; } async.waterfall([