Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
fix(search): fix root path when build in background
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarilani committed Aug 22, 2017
1 parent 52c7f24 commit b710648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/nodejs/search/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion lib/nodejs/search/child-on-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
};

0 comments on commit b710648

Please # to comment.