queue name can be anything while group_rate name is an atom
benoitc opened this issue · comments
I was trying to setup 2 queue sharing the same group_name but failed with a case_clause error while trying to use a tuple as a group_rate name. Creating the group name with a tuple is OK, but then passing this name when setting a queue fails with a case_clause
error. AFaik the group name should match an atom there:
https://github.com/uwiger/jobs/blob/master/src/jobs_server.erl#L488
I'm not sure what should be fixed there. Either fixing the code above by not matching a specific type for the name. Or fixing jobs:add_group_rate/2
and raise a badarg
error if the name is anything but atom.
Thoughts?
I see no reason to restrict group names to atom. (Judging by the code, perhaps I did once, but in such cases as these, a good memory is unpardonable, as they say).