Added timestamp to watch mode status log.
This commit is contained in:
parent
5edf5cd71b
commit
9ded9a131e
|
@ -4,6 +4,7 @@ const config = require('config');
|
||||||
const Snoowrap = require('snoowrap');
|
const Snoowrap = require('snoowrap');
|
||||||
const exiftool = require('node-exiftool');
|
const exiftool = require('node-exiftool');
|
||||||
const exiftoolBin = require('dist-exiftool');
|
const exiftoolBin = require('dist-exiftool');
|
||||||
|
const { format } = require('date-fns');
|
||||||
|
|
||||||
require('array.prototype.flatten').shim();
|
require('array.prototype.flatten').shim();
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ function fetchSavePosts(userPosts, ep) {
|
||||||
|
|
||||||
async function initApp() {
|
async function initApp() {
|
||||||
function watch() {
|
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);
|
setTimeout(initApp, Math.ceil(config.fetch.watch.interval) * 1000 * 60);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue