I have a queue that is configured like this:
queues: [
default: [
local_limit: 100,
global_limit: [
allowed: 4,
partition: [args: :tenant_id]
]
]
],
When I start a job in it, it never runs it, it will stuck in available state forever. But, if I remove the global_limit config and leave it with just the local_limit line, then the jobs run immediately.
I also noticed that, if I have the global_limit config enabled, Oban Web will not show any job at all, even if they do exist in the DB.
Not sure if it is related to the issue or not, but when I start my backend, I see this log message:
17:30:28.294 [info] {"message":"job staging switched to local mode. local mode polls for jobs for every queue; restore global mode with a functional notifier","mode":"local","source":"oban","event":"stager:switch"}
Here is my worker implementation:
defmodule Core.Workers.ApiCaller do
@moduledoc false
use Oban.Pro.Worker,
queue: :default,
recorded: [limit: 128_000_000]
require Logger
args_schema do
field :url, :string, required: true
field :args, :map, required: true
field :tenant_id, :integer, required: true
end
@impl Oban.Pro.Worker
def process(%Job{args: args} = _job) do
%{url: _url, args: _args, tenant_id: tenant_id} = args
dbg("start: #{inspect(self())} #{tenant_id}")
Process.sleep(5_000)
dbg("end: #{inspect(self())} #{tenant_id}")
{:ok, "output"}
end
end






















