From 25001e5b806ed29c40e3bfee3ec856a46f1158b3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 16 Apr 2024 15:01:04 +0200 Subject: [PATCH] :paperclip: Add minor logging improvements on worker module --- backend/src/app/worker.clj | 6 ++++-- backend/src/app/worker/cron.clj | 2 +- backend/src/app/worker/runner.clj | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/app/worker.clj b/backend/src/app/worker.clj index a648080f3b..1da2e8de08 100644 --- a/backend/src/app/worker.clj +++ b/backend/src/app/worker.clj @@ -119,11 +119,13 @@ :next.jdbc/update-count))] (l/trc :hint "submit task" :name task + :task-id (str id) :queue queue :label label :dedupe (boolean dedupe) - :deleted (or deleted 0) - :in (dt/format-duration duration)) + :delay (dt/format-duration duration) + :replace (or deleted 0)) + (db/exec-one! conn [sql:insert-new-task id task props queue label priority max-retries interval]) diff --git a/backend/src/app/worker/cron.clj b/backend/src/app/worker/cron.clj index 72a66a22b3..cb5a69d882 100644 --- a/backend/src/app/worker/cron.clj +++ b/backend/src/app/worker/cron.clj @@ -92,7 +92,7 @@ (let [ts (ms-until-valid cron) ft (px/schedule! ts (partial execute-cron-task cfg task))] - (l/dbg :hint "schedule task" :id id + (l/dbg :hint "schedule" :id id :ts (dt/format-duration ts) :at (dt/format-instant (dt/in-future ts))) diff --git a/backend/src/app/worker/runner.clj b/backend/src/app/worker/runner.clj index 11ca3d972a..e68fa484db 100644 --- a/backend/src/app/worker/runner.clj +++ b/backend/src/app/worker/runner.clj @@ -139,7 +139,7 @@ :else (try - (l/trc :hint "start task" + (l/trc :hint "start" :name (:name task) :task-id (str task-id) :queue queue @@ -149,7 +149,7 @@ result (handle-task task) elapsed (dt/format-duration (tpoint))] - (l/trc :hint "end task" + (l/trc :hint "end" :name (:name task) :task-id (str task-id) :queue queue