From b710648f74f4fe22226f694eb6bb68eecbb85d8e Mon Sep 17 00:00:00 2001 From: Ruben Barilani Date: Tue, 22 Aug 2017 10:17:27 +0200 Subject: [PATCH] fix(search): fix root path when build in background --- lib/nodejs/search/build.js | 2 +- lib/nodejs/search/child-on-message.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/nodejs/search/build.js b/lib/nodejs/search/build.js index 7f38c8f..4b62df6 100644 --- a/lib/nodejs/search/build.js +++ b/lib/nodejs/search/build.js @@ -43,7 +43,7 @@ module.exports = function build (ctx) { }, this); }); const hrend = process.hrtime(hrstart); - logger.info(`search index was built in ${hrend[0]}s, ${hrend[1] / 1000000}ms`); + logger.info(`search index was built in ${hrend[0]}s, ${(hrend[1] / 1000000).toFixed()}ms`); return { index, diff --git a/lib/nodejs/search/child-on-message.js b/lib/nodejs/search/child-on-message.js index c628a59..ed7d1c2 100644 --- a/lib/nodejs/search/child-on-message.js +++ b/lib/nodejs/search/child-on-message.js @@ -6,8 +6,9 @@ const logger = require('./logger'); module.exports = ({process}) => { return function (message) { const pages = message.pages ? Array.from(message.pages.data) : []; + const rootPath = message.rootPath || ''; logger.debug('child process got a message'); - const result = build({pages}); + const result = build({pages, rootPath}); process.send(result); }; };