Update the SyncWorker to add logging.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user