Update the SyncWorker to add logging.

dev
KKlochko 2 months ago
parent ca1c9c05d2
commit b616c0d5a0

@ -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

Loading…
Cancel
Save