Adds the commercial Oban Pro package (vendored from the towerops-web2 vendor tree) so this project can use its workers, plugins, and Smart engine features.
13 lines
304 B
Elixir
13 lines
304 B
Elixir
defmodule Oban.Pro.Limiters.Local do
|
|
@moduledoc false
|
|
|
|
@behaviour Oban.Pro.Limiter
|
|
|
|
@impl Oban.Pro.Limiter
|
|
def check(_repo, %{producer: producer, running: running}) do
|
|
{:ok, producer.meta.local_limit - map_size(running)}
|
|
end
|
|
|
|
@impl Oban.Pro.Limiter
|
|
def track(meta, _jobs), do: meta
|
|
end
|