From b616c0d5a09ffd038ea1c798177baa125b604853 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sun, 27 Apr 2025 20:15:29 +0300 Subject: [PATCH] Update the SyncWorker to add logging. --- .../sync/sync_workers/sync_worker.ex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/decentralised_book_index/sync/sync_workers/sync_worker.ex b/lib/decentralised_book_index/sync/sync_workers/sync_worker.ex index ffa130a..2a3063d 100644 --- a/lib/decentralised_book_index/sync/sync_workers/sync_worker.ex +++ b/lib/decentralised_book_index/sync/sync_workers/sync_worker.ex @@ -6,8 +6,16 @@ defmodule DecentralisedBookIndex.SyncWorker do require Logger + alias DecentralisedBookIndex.SyncTasks.SyncServerTask + @impl Oban.Worker def perform(%Oban.Job{args: args} = job) do - SyncServerTask.sync_all() + Logger.info("The cron job (#{job.id}) run SyncServerTask at #{DateTime.utc_now()} with args: #{inspect(args)}") + + result = SyncServerTask.sync_all() + + Logger.info("The cron job (#{job.id}) is done.") + + result end end