You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Just trying out labels, and it appears that if I have kwargs in the initializer of my jobs, I can't use labels.
My job:
class TestJob < ApplicationJob
include GoodJob::ActiveJobExtensions::Concurrency
include GoodJob::ActiveJobExtensions::Labels
def perform(kwarg1:, kwarg2:)
good_job_labels << did_the_thing? ? 'Foo' : 'Bar'
end
I get this in the error logs:
wrong number of arguments (given 1, expected 0; required keywords: kwarg1, kwarg2)
The text was updated successfully, but these errors were encountered:
This is an Active Job thing: ActiveJob::Base#initialize should never have its method signature changed. I think you mean to customize the #perform signature to pass parameters to a job.
@bensheldon 🤦 I created that example for this, trying to reproduce a more complicated example in my codebase. I don't have that obvious mistake in the real thing. ;-)
But still... I'm seeing that error about wrong number of arguments for perform when I add in the labels mixin.
Can you try that on your end, with a perform having kwargs and the label mixin present?
Hi,
Just trying out labels, and it appears that if I have kwargs in the initializer of my jobs, I can't use labels.
My job:
I get this in the error logs:
The text was updated successfully, but these errors were encountered: