-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentError: wrong number of arguments (given 1, expected 0; required keyword: schedule) - cron #546
Comments
@hiendinhngoc Try passing the args as an array: args: [{schedule: "5 minutes"}], |
🙌 woot! |
I am sorry, reopen this because after deploying to staging, I'm still getting this error regarding the update, active job params: {
"job_id": "c8fc128a-05de-495d-9d68-cu92483c56d8",
"locale": "en",
"priority": null,
"timezone": "UTC",
"arguments": [
{
"schedule": "5 minutes",
"_aj_hash_with_indifferent_access": true
}
],
"job_class": "External::BlazerJob",
"executions": 0,
"queue_name": "default",
"enqueued_at": "2022-03-29T04:25:00Z",
"provider_job_id": null,
"exception_executions": {
}
} Does it due to the old jobs which were already in the queue before? If yes how do I remove all the old ones? |
@hiendinhngoc I looked into it deeper and I think it may not work with kwargs. I'm a bit stumped on how to appropriately construct/pass a configuration value that has both args and kwargs to a method. Could you share the version of Ruby, and Ruby on Rails you're using? I'm doing some more research on how to handle this. |
@bensheldon I am using ruby 3.0.2 and rails 6.0.4 |
@hiendinhngoc I just released a new version (v2.11.3) that splits out an explicit five_mins_interval_check_task: {
cron: "10/5 * * * *",
class: "External::BlazerJob",
kwargs: {schedule: "5 minutes"}, # <-- change this to `kwargs`
desciption: "Run 5-minute interval checks",
} |
@bensheldon thank you for your quick support. If the arguments are more than one, what should be correct? |
Yay! One single hash. |
thank you so much! |
I got this error when setting for my job with argument:
and here is my setting:
I expected the job should be
Blazer.run_checks(schedule: "5 minutes")
after passing the argument.What was I wrong here?
The text was updated successfully, but these errors were encountered: