resque-lock-timeout
resque-lock-timeout copied to clipboard
Make “loner” implementation comply with its specification
The default loner()
method is accepting *args
, but they are not passed along where this method is called.
Note, this pull request includes a test case, but it only covers one code path, whereas I fixed 3 different places.
Long delay!
I'm inclined to merge this and trust your judgment, the problem I have is I'm not familiar with the loner plugin :/
@lantins, it’s OK, it took me a little while to regain mental image, too.
Notice how the method LonelyWithArgsJob.loner()
is implemented, echoing back the argument given to it, defaulting to false
. So, in the test, if the job is submitted with no arguments, it should not be treated as a loner, whereas submitting with an argument of true
makes it a loner and rejects the second submission.
BTW, if you run the new test on the code before this patch, the first assertion passes. It’s the other assertion that fails, because it depends on propagation of the *args
, which the patch fixes.
Hope this helps.