Update the SyncWorker to add logging.
This commit is contained in:
@@ -6,8 +6,16 @@ defmodule DecentralisedBookIndex.SyncWorker do
|
|||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
|
alias DecentralisedBookIndex.SyncTasks.SyncServerTask
|
||||||
|
|
||||||
@impl Oban.Worker
|
@impl Oban.Worker
|
||||||
def perform(%Oban.Job{args: args} = job) do
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user