Previous commit (3c988a5f) switched oban_pro to the licensed hex repo at deploy time. Reverting that — keep all three Pro packages vendored so prod image builds don't depend on oban.pro reachability or auth on every CI run. oban_pro 1.7.0 dropped into vendor/oban_pro via `mix hex.package fetch oban_pro 1.7.0 --repo=oban --unpack`. mix.exs goes back to `path: "vendor/oban_pro"` (matching oban_met / oban_web, which were already vendored — and stay vendored since the licensed repo only has older versions of those: 0.1.11 / 2.10.6 vs the 1.1.0 / 2.12.1 we vendor). Schema migration from3c988a5fstays — 1.7.0 tables/indexes are already applied. No code changes.
24 lines
762 B
Elixir
24 lines
762 B
Elixir
defmodule Oban.Pro.Flusher do
|
|
@moduledoc false
|
|
|
|
alias Oban.{Config, Job}
|
|
|
|
@doc """
|
|
Construct an MFA for flushing accumulated operations after the Smart engine transaction commits.
|
|
|
|
By convention, the function should be named `:on_flush`.
|
|
"""
|
|
@callback to_flush_mfa(Job.t(), Config.t()) :: :ignore | mfa()
|
|
|
|
@doc """
|
|
Extract flush handlers from all registered flushing modules.
|
|
|
|
The flush order is important. Workflow flushing must complete before Batch flushing to ensure
|
|
batch wrapped workflow handlers are triggered.
|
|
"""
|
|
def get_flush_handlers(job, conf) do
|
|
[Oban.Pro.Workflow, Oban.Pro.Batch, Oban.Pro.Stages.Chain]
|
|
|> Enum.map(fn handler -> handler.to_flush_mfa(job, conf) end)
|
|
|> Enum.reject(&(&1 == :ignore))
|
|
end
|
|
end
|