Can't fetch recorded job from Oban

@impl Oba.Pro.Worker
def after_process(state, job) do
  if state == :complete do
    job = Repo.get(Oban,job, job.id)
  {:ok, recorded} = fetch_recorded(job)
  else
  # Error
  end
end

But it looks like fetch_recorded/1 always return {:error, :missing}
Do you see any problem with this?

What does fetch_recorded/1 look like?

That’s because the result isn’t persisted to the database yet. Use after_process/3 instead, where the third argument is the result: Oban.Pro.Worker — Oban Pro v1.4.5.

@impl Oba.Pro.Worker
def after_process(state, job, result) do
  ...
end
1 Like