Incorrect spec for jobs_server:add_queue
jwheare opened this issue · comments
Trying to add a queue with jobs:add_queue(Name, [{regulators, ...}])
throws a warning in dialyzer:
The call jobs:add_queue(Name, Props::[{'regulators',[any(),...]},...]) will never return since it differs in the 2nd argument from the success typing arguments: (any(), [{'config',atom() | [atom() | [any()] | char()]} | {'counters',[{_,_}]} | {'group_rates',[{_,_}]} | {'interval',integer()} | {'queues',[{_,_} | {_,_,_}]}])
The jobs_server:add_queue
spec is defined here:
Line 148 in a04e8d4
And the option()
type doesn't allow regulators
as a top level option:
Lines 32 to 45 in a04e8d4
From @uwiger on Slack:
the type spec for
add_queue()
is wrong. From a quick look at the code, I think it should be-spec add_queue(queue_name(), q_opts()) -> ok.
… andq_opts()
could well be improved to be more precise.