Added timestamp to watch mode status log.

This commit is contained in:
ThePendulum 2018-07-01 03:38:29 +02:00
parent 5edf5cd71b
commit 9ded9a131e
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const config = require('config');
const Snoowrap = require('snoowrap');
const exiftool = require('node-exiftool');
const exiftoolBin = require('dist-exiftool');
const { format } = require('date-fns');
require('array.prototype.flatten').shim();
@ -40,7 +41,7 @@ function fetchSavePosts(userPosts, ep) {
async function initApp() {
function watch() {
console.log(`Watch-mode enabled, checking for new posts ${config.fetch.watch.interval} minutes from now.`);
console.log(`[${format(new Date(), 'YYYY-MM-DD HH:mm:ss')}] Watch-mode enabled, checking for new posts ${config.fetch.watch.interval} minutes from now.`);
setTimeout(initApp, Math.ceil(config.fetch.watch.interval) * 1000 * 60);
}