resque-lock-timeout icon indicating copy to clipboard operation
resque-lock-timeout copied to clipboard

Make “loner” implementation comply with its specification

Open amiryal opened this issue 10 years ago • 2 comments

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.

amiryal avatar Oct 06 '14 16:10 amiryal

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 avatar Jan 22 '15 22:01 lantins

@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.

amiryal avatar Jan 25 '15 16:01 amiryal