diff --git a/src/app.js b/src/app.js index 926e3750..e2d04855 100755 --- a/src/app.js +++ b/src/app.js @@ -8,7 +8,7 @@ const unprint = require('unprint'); // const log = require('why-is-node-running'); const Inspector = require('inspector-api'); const fs = require('fs').promises; -const { format, formatDistanceStrict } = require('date-fns'); +const { format, intervalToDuration } = require('date-fns'); const argv = require('./argv'); const initServer = require('./web/server'); @@ -211,7 +211,10 @@ async function init() { await associateMovieScenes(storedMovies, [...storedScenes, ...storedMovieScenes]); } - logger.info(`Completed in ${formatDistanceStrict(new Date(), startTime)}`); + logger.info(`Completed in ${Object.entries(intervalToDuration({ start: startTime, end: Date.now() })) + .filter(([, value]) => value > 0) + .map(([key, value]) => `${value} ${key}`) + .join(', ')}`); } catch (error) { console.trace(error); logger.error(error);