From 731e41996bf54e80d1b595778ca879b4b0ea1052 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 21 Mar 2021 00:40:03 +0100 Subject: [PATCH] Log the actual task names involved --- src/mutation-api/database.js | 4 ++-- src/task-stream.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mutation-api/database.js b/src/mutation-api/database.js index 8be5ca7..a7d9da0 100644 --- a/src/mutation-api/database.js +++ b/src/mutation-api/database.js @@ -5,10 +5,10 @@ const defaultValue = require("default-value"); module.exports = function (state) { const queries = require("../queries")(state); - return function createDatabaseMutationAPI({ tx, item, taskVersion }) { + return function createDatabaseMutationAPI({ tx, item, taskVersion, task }) { return { createItem: function (options) { - console.log(`[new] ${options.id}`); + console.log(`[${task}][new] ${options.id}`); return queries.createItem(tx, { ...options, diff --git a/src/task-stream.js b/src/task-stream.js index 2402418..d688461 100644 --- a/src/task-stream.js +++ b/src/task-stream.js @@ -124,7 +124,7 @@ module.exports = function (state) { buffer(), globalRateLimiter, processTaskSafely(task, (item, tx) => { - console.log(`[started] ${item.id}`); + console.log(`[${task}][started] ${item.id}`); let context = { tx, item, task, taskVersion }; @@ -167,7 +167,7 @@ module.exports = function (state) { expires_at: dateFns.add(new Date(), { seconds: ttlInSeconds }) }); }).catch((error) => { - console.warn(`[failed] ${item.id}`, error); + console.warn(`[${task}][failed] ${item.id}`, error); return Promise.try(() => { // Task failed -- note, cannot use tx here because it has failed